Part Number Hot Search : 
E103M DG444DVZ DT72361 TQ8101C SMB122 TFMBJ100 XF200 2N930
Product Description
Full Text Search
 

To Download Z8F4822AR020SG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  copyright ?2013 zilog ? , inc. all rights reserved. www.zilog.com product specification high performance 8-b it microcontrollers z8 encore! xp ? f64xx series ps019924-0113
ps019924-0113 p r e l i m i n a r y foreword z8 encore! xp ? f64xx series product specification ii do not use this product in life support systems. life support policy zilog?s products are not authorized fo r use as critical components in life support devices or systems without th e express prior written approval of the president and general counsel of zilog corporation. as used herein life support devices or systems are devices which (a) ar e intended for surgical implant into the body, or (b) support or sustain life and whose failure to perform when properly used in accordan ce with instructions for use provided in the labeling can be reasonably expected to result in a si gnificant injury to the user. a criti- cal component is any component in a life support device or system whose failure to perform can be reason- ably expected to cause the failure of the life support devi ce or system or to affect its safety or effectiveness. document disclaimer ?2013 zilog, inc. all rights reserved. information in this publicat ion concerning the devices, applications, or technology described is intend ed to suggest possible uses and ma y be superseded. zilog, inc. does not assume liability for or provide a representation of accuracy of the information, devices, or technology described in this document. zilog also does not assume liability for intellectual property infringement related in any manner to use of informati on, devices, or technology described herein or otherwise. the information contained w ithin this document has been verified according to the general principles of electrical and mechanical engineering. z8, z8 encore!, z8 encore! xp and z8 encore! mc are trademarks or regi stered trademarks of zilog, inc. all other product or service names are th e property of their respective owners. warning:
ps019924-0113 p r e l i m i n a r y revision history z8 encore! xp ? f64xx series product specification iii revision history each instance in the revision hi story table reflects a change to this document from its pre- vious revision. for more details, refer to the corresponding pages or appropriate links listed in the table below. date revision level description page jan 2013 24 restored 40-pin pdip package to signal and pin descriptions and packag- ing chapters. 7 , 286 feb 2012 23 corrected formatting of i dds section, table 107; corrected language in the general purpose ram section of appendix a; 202 , 248 sep 2011 22 revised flash sector protect regist er description; revised packaging chapter. 178 , 286 mar 2008 21 changed title to z8 encore! xp f64xx series. all feb 2008 20 changed z8 encore! xp 64k series flash microcontrollers to z8 encore! xp f64xx series flash microcontrollers. deleted three sentences that men- tioned z8r642. removed the 40 pdip package. added zenetsc0100zacg to the end of the ordering information table. changed the flag status to unaffected for bit, bset, and bclr in the ez8 cpu instruction summary table. 287 , 234 dec 2007 19 updated zilog logo, disclaimer sect ion, and implemented style guide. updated table 113. changed z8 encore! 64k series to z8 encore! xp 64k series flash microcontrollers throughout the document. all dec 2006 18 updated flash memory electrical characteristics and timing table and ordering information chapter. 213 , 287 nov 2006 17 updated part number suffix designations section. 292
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification iv table of contents revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii list of figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi list of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 part selection guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 cpu and peripheral overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 general-purpose input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 flash controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 10-bit analog-to-digital converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 uarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 i 2 c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 serial peripheral interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 reset controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 on-chip debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 dma controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 signal and pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 available packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 pin configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 register file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 data memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 information area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 register file address map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 reset and stop mode recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 reset types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 reset sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 voltage brown-out reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification v watchdog timer reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 external pin reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 on-chip debugger initiated reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 stop mode recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 stop mode recovery using watchdog timer ti me-out . . . . . . . . . . . . . . . . . 33 stop mode recove ry using a gpio port pin transition halt . . . . . . . . . . . . 33 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 general-purpose i/o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 gpio port availability by device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 gpio alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 gpio interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 gpio control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 port a?h address registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 port a?h control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 port a?h input data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 port a?h output data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 interrupt vector listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 9 master interrupt enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 interrupt vectors and priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 interrupt assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 software interrupt assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 interrupt control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 interrupt request 0 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 interrupt request 1 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 interrupt request 2 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 irq0 enable high and low bit registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 irq1 enable high and low bit registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 irq2 enable high and low bit registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 interrupt edge select register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 interrupt port select register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 interrupt control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification vi operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 timer operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 reading the timer count values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 timer output signal operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 timer control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 timer 0?3 high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 timer reload high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 timer 0?3 pwm high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . . 75 timer 0?3 control 0 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 timer 0?3 control 1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0 watchdog timer refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 watchdog timer time-out response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 watchdog timer reload un lock sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 watchdog timer control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 watchdog timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 watchdog timer reload upper, high and low byte registers . . . . . . . . . . . . 85 universal asynchronous receiver/transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 8 transmitting data using the polled method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 transmitting data using the interrupt-driven meth od . . . . . . . . . . . . . . . . . . . 90 receiving data using the polled method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 receiving data using the interrupt-driven method . . . . . . . . . . . . . . . . . . . . . . 92 clear to send (cts) operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 multiprocessor (9-bit) mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 external driver enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 uart interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 uart baud rate generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 uart control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 uart transmit data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 uart receive data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 uart status 0 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 uart status 1 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 uart control 0 and control 1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 uart address compare register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 uart baud rate high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . 105 infrared encoder/decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 09 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification vii operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 transmitting irda data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 receiving irda data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 infrared encoder/decoder control register definitions . . . . . . . . . . . . . . . . . . . . 112 serial peripheral interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 spi signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 spi clock phase and polarity control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 multimaster operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 slave operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 spi interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 spi baud rate generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 spi control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 spi data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 spi control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 spi status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 spi mode register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 spi diagnostic state register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 spi baud rate high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . . . 126 i 2 c controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 sda and scl signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 i 2 c interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 software control of i 2 c transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 start and stop conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 master write and read transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 address only transaction with a 7-bit address . . . . . . . . . . . . . . . . . . . . . . . 133 write transaction with a 7-bit address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 address only transaction with a 10-bit address . . . . . . . . . . . . . . . . . . . . . . 135 write transaction with a 10-bit address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 read transaction with a 7-bit address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 read transaction with a 10-bit address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 i 2 c control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 i 2 c data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 i 2 c status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 i 2 c control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 i 2 c baud rate high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . . . 145
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification viii i 2 c diagnostic state register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 i 2 c diagnostic control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 direct memory access controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 configuring dma0 and dma1 for data transfer . . . . . . . . . . . . . . . . . . . . . 150 dma_adc operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 configuring dma_adc for data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 dma control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 dmax control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 dmax i/o address register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 dmax address high nibble register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 dmax start/current address low byte register . . . . . . . . . . . . . . . . . . . . . . 156 dmax end address low byte register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 dma_adc address register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 dma_adc control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 dma_adc status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 analog-to-digital converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 automatic power-down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 single-shot conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 continuous conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 dma control of the adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 adc control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 adc control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 adc data high byte register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 adc data low bits register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 information area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 timing using the flash frequency registers . . . . . . . . . . . . . . . . . . . . . . . . . 171 flash read protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 flash write/erase protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 byte programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 page erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 mass erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 flash controller bypass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 flash controller behavior in debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 flash control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 flash control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification ix flash status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 page select register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 flash sector protect register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 flash frequency high and low byte registers . . . . . . . . . . . . . . . . . . . . . . . . 179 option bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 option bit configuration by reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 option bit address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 flash memory address 0000h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 flash memory address 0001h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 on-chip debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 ocd interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 ocd data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 ocd autobaud detector/generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 ocd serial errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 on-chip debugger commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 on-chip debugger control register definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 193 ocd control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 ocd status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 on-chip oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 crystal oscillator operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 oscillator operation with an external rc network . . . . . . . . . . . . . . . . . . . . . . . . 198 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 on-chip peripheral ac and dc electrical characteristics . . . . . . . . . . . . . . . . . . 211 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 general-purpose i/o port input data sample ti ming . . . . . . . . . . . . . . . . . . . 217 general-purpose i/o port output timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 on-chip debugger timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 spi master mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 spi slave mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 i 2 c timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 uart timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
ps019924-0113 p r e l i m i n a r y table of contents z8 encore! xp ? f64xx series product specification x ez8 cpu instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 assembly language programming introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 225 assembly language syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 ez8 cpu instruction notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 condition codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 ez8 cpu instruction classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 ez8 cpu instruction summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 flags register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 op code maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 appendix a. register tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 general purpose ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 timer 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 8 universal asynchronous receiver/transmitter (uart) . . . . . . . . . . . . . . . . . . . . 256 inter-integrated circuit (i 2 c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 serial peripheral interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 analog-to-digital converter (adc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 direct memory access (dma) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 interrupt request (irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 general-purpose input/output (gpio) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 part number suffix designations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 customer support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
ps019924-0113 p r e l i m i n a r y list of figures z8 encore! xp ? f64xx series product specification xi list of figures figure 1. z8 encore! xp f64xx series block diagram . . . . . . . . . . . . . . . . . . . . . . . . 3 figure 2. z8 encore! xp f64xx series in 40-pin dual inline package (pdip) . . . . . . 8 figure 3. z8 encore! xp f64xx series in 44-pin plastic leaded chip carrier (plcc) 9 figure 4. z8 encore! xp f64xx series in 44-pin low-profile quad flat ? ? ?
ps019924-0113 p r e l i m i n a r y list of figures z8 encore! xp ? f64xx series product specification xii figure 31. 10-bit addressed slave data transfer format . . . . . . . . . . . . . . . . . . . . . 136 figure 32. receive data transfer format for a 7-bit addressed slave . . . . . . . . . . . 138 figure 33. receive data format for a 10-bit addressed slave . . . . . . . . . . . . . . . . . 139 figure 34. analog-to-digital conver ter block diagram . . . . . . . . . . . . . . . . . . . . . . 162 figure 35. flash memory arrangement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 figure 36. on-chip debugger block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 figure 37. interfacing the on-chip debugg er?s dbg pin with an rs-232 interface, ? #1 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 figure 38. interfacing the on-chip debugg er?s dbg pin with an rs-232 interface, ? #2 of 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 figure 39. ocd data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 figure 40. recommended 20 mhz crystal oscillator configuration . . . . . . . . . . . . . 197 figure 41. connecting the on-chip oscillator to an external rc network . . . . . . . . 198 figure 42. typical rc oscillator freq uency as a function of the external ? capacitance with a 45 k ? resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 figure 43. typical active mode idd vs. system clock frequency . . . . . . . . . . . . . . 205 figure 44. maximum active mode idd vs. system clock frequency . . . . . . . . . . . . 206 figure 45. typical halt mode idd vs. system cl ock frequency . . . . . . . . . . . . . . 207 figure 46. maximum halt mode icc vs. system clock frequency . . . . . . . . . . . . 208 figure 47. maximum stop mode idd with vbo enabled vs. power supply ? voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 figure 48. maximum stop mode idd with vbo disabled vs. power supply ? voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 figure 49. analog-to-digital converter frequenc y response . . . . . . . . . . . . . . . . . . 215 figure 50. port input sample timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 figure 51. gpio port output timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 figure 52. on-chip debugger timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 figure 53. spi master mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 figure 54. spi slave mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 figure 55. i 2 c timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 figure 56. uart timing with cts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 figure 57. uart timing without cts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 figure 58. flags register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 figure 59. op code map cell description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 figure 60. first op code map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 figure 61. second op code map after 1fh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xiii list of tables table 1. z8 encore! xp f64xx series part selectio n guide . . . . . . . . . . . . . . . . . . . . 2 table 2. z8 encore! xp f64xx seri es package options . . . . . . . . . . . . . . . . . . . . . . . 7 table 3. signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 table 4. pin characteristics of the z8 encore! xp f64xx series . . . . . . . . . . . . . . . 17 table 5. z8 encore! xp f64xx series program me mory maps . . . . . . . . . . . . . . . . 19 table 6. z8 encore! xp f64xx seri es information area map . . . . . . . . . . . . . . . . . 21 table 7. z8 encore! xp f64xx series register file address map . . . . . . . . . . . . . . 22 table 8. reset and stop mode recovery character istics and latency . . . . . . . . . . . 28 table 9. reset sources and resulting reset type . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 10. stop mode recovery so urces and resulting action . . . . . . . . . . . . . . . . . . 33 table 11. port availability by device and package type . . . . . . . . . . . . . . . . . . . . . . 36 table 12. port alternate function mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 13. gpio port registers and subregisters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 14. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . . 40 table 15. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 16. port a?h data direction subregisters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 17. port a?h alternate function subregisters . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 18. port a ? h output control subregisters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 table 19. port a?h high drive enable subregisters . . . . . . . . . . . . . . . . . . . . . . . . . 44 table 20. port a?h stop mode recovery source en able subregisters . . . . . . . . . . . 45 table 21. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 table 22. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . . 46 table 23. interrupt vectors in order of priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 table 24. interrupt request 0 register (irq0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 table 25. interrupt request 1 register (irq1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 table 26. interrupt request 2 register (irq2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 table 27. irq0 enable and priority encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 table 28. irq0 enable high bit register (irq0enh) . . . . . . . . . . . . . . . . . . . . . . . 55 table 29. irq0 enable low bit register (irq0enl) . . . . . . . . . . . . . . . . . . . . . . . . 56 table 30. irq1 enable and priority encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 table 31. irq1 enable high bit register (irq1enh) . . . . . . . . . . . . . . . . . . . . . . . 57 table 32. irq1 enable low bit register (irq1enl) . . . . . . . . . . . . . . . . . . . . . . . . 57 table 33. irq2 enable and priority encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xiv table 34. irq2 enable high bit register (irq2enh) . . . . . . . . . . . . . . . . . . . . . . . 58 table 35. irq2 enable low bit register (irq2enl) . . . . . . . . . . . . . . . . . . . . . . . . 59 table 36. interrupt edge select register (irqes) . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 37. interrupt port select register (irqps) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 38. interrupt control register (irqctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 table 39. timer 0?3 high byte register (txh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 table 40. timer 0?3 low byte register (txl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 table 41. timer 0?3 reload high byte register (t xrh) . . . . . . . . . . . . . . . . . . . . . . 74 table 42. timer 0?3 reload low byte register (txr l) . . . . . . . . . . . . . . . . . . . . . . 74 table 43. timer 0?3 pwm high byte register (txpwmh) . . . . . . . . . . . . . . . . . . . 75 table 44. timer 0?3 pwm low byte register (txp wml) . . . . . . . . . . . . . . . . . . . . 75 table 45. timer 0?3 control 0 register (txctl0) . . . . . . . . . . . . . . . . . . . . . . . . . . 76 table 46. timer 0?3 control 1 register (txctl1) . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 47. watchdog timer approximate time-out de lays . . . . . . . . . . . . . . . . . . . . 81 table 48. watchdog timer control register (wdtctl) . . . . . . . . . . . . . . . . . . . . . 84 table 49. watchdog timer events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 table 50. watchdog timer reload upper byte register (wdtu) . . . . . . . . . . . . . . 85 table 51. watchdog timer reload high byte regi ster (wdth) . . . . . . . . . . . . . . . 86 table 52. watchdog timer reload low byte regist er (wdtl) . . . . . . . . . . . . . . . . 86 table 53. uart transmit data register (uxtxd) . . . . . . . . . . . . . . . . . . . . . . . . . . 99 table 54. uart receive data register (uxrxd) . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 table 55. uart status 0 register (uxstat0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 table 56. uart status 1 register (uxstat1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 table 57. uart control 0 register (uxctl0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 table 58. uart control 1 register (uxctl1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 table 59. uart address compare register (uxaddr) . . . . . . . . . . . . . . . . . . . . . 105 table 60. uart baud rate high byte register (uxbrh) . . . . . . . . . . . . . . . . . . . 106 table 61. uart baud rate low byte register (uxbrl) . . . . . . . . . . . . . . . . . . . . 106 table 62. uart baud rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 table 63. spi clock phase (phase) and cloc k polarity (clkpol) operation . . . 117 table 64. spi data register (spidata) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 table 65. spi control register (spictl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 table 66. spi status register (spistat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 table 67. spi mode register (spimode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 table 68. spi diagnostic state register (spidst) . . . . . . . . . . . . . . . . . . . . . . . . . . 126 table 69. spi baud rate high byte register (spibrh) . . . . . . . . . . . . . . . . . . . . . 127
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xv table 70. spi baud rate low byte register (spibrl) . . . . . . . . . . . . . . . . . . . . . . 127 table 71. i 2 c data register (i2cdata) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 table 72. i2c status register (i2cstat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 table 73. i2c control register (i2cctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 table 74. i 2 c baud rate low byte register (i2cbrl) . . . . . . . . . . . . . . . . . . . . . . 146 table 75. i 2 c baud rate high byte regi ster (i2cbrh) . . . . . . . . . . . . . . . . . . . . . 146 table 76. i 2 c diagnostic state register (i2cdst) . . . . . . . . . . . . . . . . . . . . . . . . . . 147 table 77. i 2 c diagnostic control register (i2cdiag) . . . . . . . . . . . . . . . . . . . . . . 149 table 78. dmax control register (dmaxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 table 79. dmax i/o address register (dmaxio) . . . . . . . . . . . . . . . . . . . . . . . . . 154 table 80. dmax address high nibble register (dmaxh) . . . . . . . . . . . . . . . . . . . 155 table 81. dmax start/current address low byte register (dmaxstart) . . . . . 156 table 82. dmax end address low byte register (dmaxend) . . . . . . . . . . . . . . 156 table 83. dma_adc register file address example . . . . . . . . . . . . . . . . . . . . . . . 157 table 84. dma_adc control register (dmaactl) . . . . . . . . . . . . . . . . . . . . . . . 158 table 85. dma_adc address register (dmaa_addr) . . . . . . . . . . . . . . . . . . . 158 table 86. dma_adc status register (dmaa_stat) . . . . . . . . . . . . . . . . . . . . . . 159 table 87. adc control register (adcctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 table 88. adc data high byte register (adcd_h) . . . . . . . . . . . . . . . . . . . . . . . . 167 table 89. adc data low bits register (adcd_l) . . . . . . . . . . . . . . . . . . . . . . . . . 168 table 90. flash memory configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 table 91. flash memory sector addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 table 92. z8 encore! xp f64xx se ries information area map . . . . . . . . . . . . . . . . 171 table 93. flash control register (fctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 table 94. flash status register (fstat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 table 95. flash sector protect register (fprot) . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 table 96. page select register (fps) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 table 97. flash frequency high byte register ( ffreqh) . . . . . . . . . . . . . . . . . . . 179 table 98. flash frequency low byte register (ffr eql) . . . . . . . . . . . . . . . . . . . . 179 table 99. flash option bits at flash memory address 0000h . . . . . . . . . . . . . . . . 181 table 100. options bits at flash memory address 0001h . . . . . . . . . . . . . . . . . . . . . 182 table 101. ocd baud-rate limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 table 102. on-chip debugger commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 table 103. ocd control register (ocdctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 table 104. ocd status register (ocdstat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 table 105. recommended crystal oscillator sp ecifications (20 mhz operation) . . . 197
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xvi table 106. absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 table 107. dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 table 108. power-on reset and voltage br own-out electrical characteristics ? and timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 table 109. reset and stop mode recovery pin timing . . . . . . . . . . . . . . . . . . . . . . . 212 table 110. external rc oscillator electrical char acteristics and timing . . . . . . . . . 212 table 111. flash memory electrical characteristic s and timing . . . . . . . . . . . . . . . . 213 table 112. watchdog timer electrical characteri stics and timing . . . . . . . . . . . . . . 213 table 113. analog-to-digital converter electrical characteristics and timing . . . . . 214 table 114. ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 table 115. gpio port input timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 table 116. gpio port output timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 table 117. on-chip debugger timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 table 118. spi master mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 table 119. spi slave mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 table 120. i 2 c timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 table 121. uart timing with cts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 table 122. uart timing without cts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 table 123. assembly language syntax example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 226 table 124. assembly language syntax example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 227 table 125. notational shorthand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 table 126. additional symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 table 127. condition codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 table 128. arithmetic instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 table 129. bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 table 130. block transfer instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 table 131. cpu control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 table 132. load instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 table 133. logical instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 table 134. program control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 table 135. rotate and shift instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 table 136. ez8 cpu instruction summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 table 137. op code map abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 table 138. timer 0?3 high byte register (txh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 table 139. timer 0?3 low byte register (txl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 table 140. timer 0?3 reload high byte register (t xrh) . . . . . . . . . . . . . . . . . . . . . 249
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xvii table 141. timer 0?3 reload low byte register (txr l) . . . . . . . . . . . . . . . . . . . . . 249 table 142. timer 0?3 pwm high byte register (txpwmh) . . . . . . . . . . . . . . . . . . 249 table 143. timer 0?3 pwm low byte register (txpwml) . . . . . . . . . . . . . . . . . . . 250 table 144. timer 0?3 control 0 register (txctl0) . . . . . . . . . . . . . . . . . . . . . . . . . 250 table 145. timer 0?3 control 1 register (txctl1) . . . . . . . . . . . . . . . . . . . . . . . . . 250 table 146. timer 0?3 high byte register (txh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 table 147. timer 0?3 low byte register (txl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 table 148. timer 0?3 reload high byte register (t xrh) . . . . . . . . . . . . . . . . . . . . . 251 table 149. timer 0?3 reload low byte register (txr l) . . . . . . . . . . . . . . . . . . . . . 251 table 150. timer 0?3 pwm high byte register (txpwmh) . . . . . . . . . . . . . . . . . . 251 table 151. timer 0?3 pwm low byte register (txpwml) . . . . . . . . . . . . . . . . . . . 252 table 152. timer 0?3 control 0 register (txctl0) . . . . . . . . . . . . . . . . . . . . . . . . . 252 table 153. timer 0?3 control 1 register (txctl1) . . . . . . . . . . . . . . . . . . . . . . . . . 252 table 154. timer 0?3 high byte register (txh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 table 155. timer 0?3 low byte register (txl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 table 156. timer 0?3 reload high byte register (t xrh) . . . . . . . . . . . . . . . . . . . . . 253 table 157. timer 0?3 reload low byte register (txr l) . . . . . . . . . . . . . . . . . . . . . 253 table 158. timer 0?3 pwm high byte register (txpwmh) . . . . . . . . . . . . . . . . . . 253 table 159. timer 0?3 pwm low byte register (txpwml) . . . . . . . . . . . . . . . . . . . 254 table 160. timer 0?3 control 0 register (txctl0) . . . . . . . . . . . . . . . . . . . . . . . . . 254 table 161. timer 0?3 control 1 register (txctl1) . . . . . . . . . . . . . . . . . . . . . . . . . 254 table 162. timer 0?3 high byte register (txh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 table 163. timer 0?3 low byte register (txl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 table 164. timer 0?3 reload high byte register (t xrh) . . . . . . . . . . . . . . . . . . . . . 255 table 165. timer 0?3 reload low byte register (txr l) . . . . . . . . . . . . . . . . . . . . . 255 table 166. timer 0?3 pwm high byte register (txpwmh) . . . . . . . . . . . . . . . . . . 255 table 167. timer 0?3 pwm low byte register (txpwml) . . . . . . . . . . . . . . . . . . . 256 table 168. timer 0?3 control 0 register (txctl0) . . . . . . . . . . . . . . . . . . . . . . . . . 256 table 169. timer 0?3 control 1 register (txctl1) . . . . . . . . . . . . . . . . . . . . . . . . . 256 table 170. uart transmit data register (uxtxd) . . . . . . . . . . . . . . . . . . . . . . . . . 257 table 171. uart receive data register (uxrxd) . . . . . . . . . . . . . . . . . . . . . . . . . . 257 table 172. uart status 0 register (uxstat0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 table 173. uart control 0 register (uxctl0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 table 174. uart control 1 register (uxctl1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 table 175. uart status 1 register (uxstat1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 table 176. uart address compare register (uxaddr) . . . . . . . . . . . . . . . . . . . . . 258
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xviii table 177. uart baud rate high byte register (uxbrh) . . . . . . . . . . . . . . . . . . . 258 table 178. uart baud rate low byte register (uxbrl) . . . . . . . . . . . . . . . . . . . . 259 table 179. uart transmit data register (uxtxd) . . . . . . . . . . . . . . . . . . . . . . . . . 259 table 180. uart receive data register (uxrxd) . . . . . . . . . . . . . . . . . . . . . . . . . . 259 table 181. uart status 0 register (uxstat0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 table 182. uart control 0 register (uxctl0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 table 183. uart control 1 register (uxctl1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 table 184. uart status 1 register (uxstat1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 table 185. uart address compare register (uxaddr) . . . . . . . . . . . . . . . . . . . . . 260 table 186. uart baud rate high byte register (uxbrh) . . . . . . . . . . . . . . . . . . . 261 table 187. uart baud rate low byte register (uxbrl) . . . . . . . . . . . . . . . . . . . . 261 table 188. i 2 c data register (i2cdata) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 table 189. i 2 c status register (i2cstat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 table 190. i 2 c control register (i2cctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 table 191. i 2 c baud rate high byte regi ster (i2cbrh) . . . . . . . . . . . . . . . . . . . . . 262 table 192. i 2 c baud rate low byte register (i2cbrl) . . . . . . . . . . . . . . . . . . . . . . 262 table 193. i 2 c diagnostic state register (i2cdst) . . . . . . . . . . . . . . . . . . . . . . . . . . 263 table 194. i 2 c diagnostic control register (i2cdiag) . . . . . . . . . . . . . . . . . . . . . . 263 table 195. spi data register (spidata) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 table 196. spi control register (spictl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 table 197. spi status register (spistat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 table 198. spi mode register (spimode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 table 199. spi diagnostic state register (spidst) . . . . . . . . . . . . . . . . . . . . . . . . . . 265 table 200. spi baud rate high byte register (spibrh) . . . . . . . . . . . . . . . . . . . . . 265 table 201. spi baud rate low byte register (spibrl) . . . . . . . . . . . . . . . . . . . . . . 265 table 202. adc data high byte register (adcd_h) . . . . . . . . . . . . . . . . . . . . . . . . 266 table 203. adc data low bits register (adcd_l) . . . . . . . . . . . . . . . . . . . . . . . . . 266 table 204. dmax control register (dmaxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 table 205. dmax i/o address register (dmaxio) . . . . . . . . . . . . . . . . . . . . . . . . . 267 table 206. dmax address high nibble register (dmaxh) . . . . . . . . . . . . . . . . . . . 267 table 207. dmax start/current address low byte register (dmaxstart) . . . . . 267 table 208. dmax end address low byte register (dmaxend) . . . . . . . . . . . . . . 268 table 209. dmax control register (dmaxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 table 210. dmax i/o address register (dmaxio) . . . . . . . . . . . . . . . . . . . . . . . . . 268 table 211. dmax address high nibble register (dmaxh) . . . . . . . . . . . . . . . . . . . 269 table 212. dmax start/current address low byte register (dmaxstart) . . . . . 269
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xix table 213. dmax end address low byte register (dmaxend) . . . . . . . . . . . . . . 269 table 214. dma_adc address register (dmaa_addr) . . . . . . . . . . . . . . . . . . . 269 table 215. dma_adc control register (dmaactl) . . . . . . . . . . . . . . . . . . . . . . . 270 table 216. dma_adc status register (dmaa_stat) . . . . . . . . . . . . . . . . . . . . . . 270 table 217. interrupt request 0 register (irq0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 table 218. irq0 enable high bit register (irq0enh) . . . . . . . . . . . . . . . . . . . . . . 271 table 219. irq0 enable low bit register (irq0enl) . . . . . . . . . . . . . . . . . . . . . . . 271 table 220. interrupt request 1 register (irq1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 table 221. irq1 enable high bit register (irq1enh) . . . . . . . . . . . . . . . . . . . . . . 271 table 222. irq1 enable low bit register (irq1enl) . . . . . . . . . . . . . . . . . . . . . . . 272 table 223. interrupt request 2 register (irq2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 table 224. irq2 enable high bit register (irq2enh) . . . . . . . . . . . . . . . . . . . . . . 272 table 225. irq2 enable low bit register (irq2enl) . . . . . . . . . . . . . . . . . . . . . . . 272 table 226. interrupt edge select register (irqes) . . . . . . . . . . . . . . . . . . . . . . . . . . 273 table 227. interrupt port select register (irqps) . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 table 228. interrupt control register (irqctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 table 229. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 274 table 230. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 table 231. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 table 232. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 275 table 233. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 275 table 234. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 table 235. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 table 236. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 276 table 237. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 276 table 238. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 table 239. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 table 240. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 277 table 241. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 277 table 242. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 table 243. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 table 244. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 278 table 245. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 278 table 246. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 table 247. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 table 248. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 279
ps019924-0113 p r e l i m i n a r y list of tables z8 encore! xp ? f64xx series product specification xx table 249. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 279 table 250. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 table 251. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 table 252. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 280 table 253. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 280 table 254. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 table 255. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 table 256. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 281 table 257. port a?h gpio address registers (pxaddr) . . . . . . . . . . . . . . . . . . . . 281 table 258. port a?h control registers (pxctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 table 259. port a?h input data registers (pxin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 table 260. port a?h output data register (pxout) . . . . . . . . . . . . . . . . . . . . . . . . . 282 table 261. watchdog timer control register (wdtc tl) . . . . . . . . . . . . . . . . . . . . 282 table 262. watchdog timer reload upper byte re gister (wdtu) . . . . . . . . . . . . . 282 table 263. watchdog timer reload high byte re gister (wdth) . . . . . . . . . . . . . . 283 table 264. watchdog timer reload low byte regi ster (wdtl) . . . . . . . . . . . . . . . 283 table 265. flash control register (fctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 table 266. flash status register (fstat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 table 267. page select register (fps) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 table 268. flash frequency high byte register ( ffreqh) . . . . . . . . . . . . . . . . . . . 285 table 269. flash frequency low byte register (ffr eql) . . . . . . . . . . . . . . . . . . . . 285 table 270. flash sector protect register (fprot) . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 table 271. z8 encore! xp f64xx series ordering ma trix . . . . . . . . . . . . . . . . . . . . . 287
ps019924-0113 p r e l i m i n a r y introduction z8 encore! xp ? f64xx series product specification 1 introduction zilog?s z8 encore! xp f64xx series mcu family of products are a line of zilog micro- controller products based upon the 8-bit ez8 cp u. the z8 encore! xp f64xx series adds flash memory to zilog?s extensive line of 8- bit microcontrollers. the flash in-circuit pro- gramming capability allows for faster develo pment time and program ch anges in the field. the new ez8 cpu is upward-com patible with existing z8 in structions. the rich-periph- eral set of the z8 encore! xp f64xx series ma kes it suitable for a variety of applications including motor control, secur ity systems, home appliances, personal electronic devices, and sensors. features the features of z8 encore! xp f64xx series include: ? 20 mhz ez8 cpu ? up to 64 kb flash with in -circuit programming capability ? up to 4 kb register ram ? 12-channel, 10-bit analog-to-digital converter (adc) ? two full-duplex 9-bit uarts with bus transceiver driver enable control ? inter-integrated circuit (i 2 c) ? serial peripheral interface (spi) ? two infrared data association (irda)-c ompliant infrared encoder/decoders ? up to four 16-bit timers with capture, compare and pwm capability ? watchdog timer (wdt) with internal rc oscillator ? three-channel dma ? up to 60 input/output (i/o) pins ? 24 interrupts with configurable priority ? on-chip debugger ? voltage brown-out (vbo) protection ? power-on reset (por) ? operating voltage of 3.0 v to 3.6 v with 5 v-tolerant inputs ? 0c to +70c, ?40c to +105c, and ?40 c to +125c operating temperature ranges
ps019924-0113 p r e l i m i n a r y part selection guide z8 encore! xp ? f64xx series product specification 2 part selection guide table 1 identifies the basic features and package styles available for each device within the z8 encore! xp product line. table 1. z8 encore! xp f64xx series part selection guide part number flash (kb) ram (kb) i/o 16-bit timers with pwm adc inputs uarts with irda i 2 c spi 40-/ 44-pin package 64/68-pin package 80-pin package z8f1621 16 2 31 3 8 2 1 1 x z8f1622 16 2 46 4 12 2 1 1 x z8f2421 24 2 31 3 8 2 1 1 x z8f2422 24 2 46 4 12 2 1 1 x z8f3221 32 2 31 3 8 2 1 1 x z8f3222 32 2 46 4 12 2 1 1 x z8f4821 48 4 31 3 8 2 1 1 x z8f4822 48 4 46 4 12 2 1 1 x z8f4823 48 4 60 4 12 2 1 1 x z8f6421 64 4 31 3 8 2 1 1 x z8f6422 64 4 46 4 12 2 1 1 x z8f6423 64 4 60 4 12 2 1 1 x note: for die form sales, contact your local zilog sales office .
ps019924-0113 p r e l i m i n a r y block diagram z8 encore! xp ? f64xx series product specification 3 block diagram figure 1 displays the architecture of the z8 encore! xp f64xx series. cpu and peripheral overview the latest 8-bit ez8 cpu meets the continuing demand for faster and more code-efficient microcontrollers. the ez8 cpu executes a supe rset of the original z8 instruction set. ez8 cpu features include: ? direct register-to-register architecture allows each register to fu nction as an accumula- tor, improving execution time and decreasing the required program memory figure 1. z8 encore! xp f64xx series block diagram gpio irda uarts i 2 c timers spi adc flash controller ram ram controller flash interrupt controller on-chip debugger ez8 tm cpu wdt with rc oscillator por/vbo and reset controller xtal/rc oscillator register bus memory busses system clock dma memory
ps019924-0113 p r e l i m i n a r y cpu and peripheral overview z8 encore! xp ? f64xx series product specification 4 ? software stack allows much greater depth in subroutine calls and interrupts than hard- ware stacks ? compatible with existing z8 code ? expanded internal register file allows access of up to 4 kb ? new instructions improve execution efficiency for code developed using higher-level programming languages, including c ? pipelined instruction fetch and execution ? new instructions for improv ed performance including bit, bswap, btj, cpc, ldc, ldci, lea, mult and srl ? new instructions support 12-bit linea r addressing of the register file ? up to 10 mips operation ? c-compiler friendly ? 2 to 9 clock cycles per instruction ? general-purpose input/output the z8 encore! xp f64xx series features seven 8-bit ports (ports a?g) and one 4-bit port (port h) for general-purpose in put/output (gpio). each pin is individually programmable. all ports (except b and h) su pport 5 v-tolerant inputs. flash controller the flash controller programs and er ases the contents of flash memory. 10-bit analog-to- digital converter the analog-to-digital converter converts an analog input signal to a 10-bit binary num- ber. the adc accepts inputs from up to 12 different analog input sources. uarts each uart is full-duplex and capable of handling asynchronous data transfers. the uarts support 8- and 9-bit data modes, select able parity, and an efficient bus transceiver driver enable signal for controlling a multitransceiver bus, such as rs-485.
ps019924-0113 p r e l i m i n a r y cpu and peripheral overview z8 encore! xp ? f64xx series product specification 5 i 2 c the i 2 c controller makes the z8 encore! xp f64xx series compatible with the i 2 c proto- col. the i 2 c controller consists of two bidirectiona l bus lines, a serial data (sda) line and a serial clock (scl) line. serial peripheral interface the serial peripheral interface allows the z8 encore! xp f64xx series to exchange data between other peripheral devices such as eeproms, a/d converters and isdn devices. the spi is a full-duplex, synchronous, characte r-oriented channel that supports a four-wire interface. timers up to four 16-bit reloadable timers can be used for timing/counting events or for motor control operations. these timers provide a 16 -bit programmable reload counter and oper- ate in one-shot, continuous, gated, capture, compare, capture and compare and pwm modes. only 3 timers (timer 0?2) are available in the 44-pin pack- age. interrupt controller the z8 encore! xp f64xx series products support up to 24 interrupts. these interrupts consist of 12 internal and 12 gpio pins. the interrupts have 3 levels of programmable interrupt priority. reset controller the z8 encore! xp f64xx series can be reset using the reset pin, power-on reset, watchdog timer, stop mode exit, or voltage brown-out ( vbo ) warning signal. on-chip debugger the z8 encore! xp f64xx series features an integrated on-chip debugger. the ocd provides a rich set of debugging capabilities, such as reading and writing registers, pro- gramming the flash, setting breakpoints and executing code. a single-pin interface pro- vides communication to the ocd.
ps019924-0113 p r e l i m i n a r y cpu and peripheral overview z8 encore! xp ? f64xx series product specification 6 dma controller the z8 encore! xp f64xx series feature three channels of dma. two of the channels are for register ram to and from i/o operations. the third channel automa tically controls the transfer of data from the adc to the memory.
ps019924-0113 p r e l i m i n a r y signal and pin descriptions z8 encore! xp ? f64xx series product specification 7 signal and pin descriptions the z8 encore! xp f64xx series product are av ailable in a variety of packages styles and pin configurations. this chapter describes the signals and available pin configurations for each of the package styles. for information ab out physical package specifications, see the p ackaging chapter on page 286. available packages table 2 identifies the package st yles that are available for each device within the z8 encore! xp f64xx series product line. table 2. z8 encore! xp f64xx series package options part number 40-pin pdip 44-pin lqfp 44-pin plcc 64-pin lqfp 68-pin plcc 80-pin qfp z8f1621 x x x z8f1622 x x z8f2421 x x x z8f2422 x x z8f3221 x x x z8f3222 x x z8f4821 x x x z8f4822 x x z8f4823 x z8f6421 x x x z8f6422 x x z8f6423 x
ps019924-0113 p r e l i m i n a r y pin configurations z8 encore! xp ? f64xx series product specification 8 pin configurations figures 2 through 7 display the pin configuratio ns for all of the packages available in the z8 encore! xp f64xx series. for signal descriptions, see table 3 on page 14. timer 3 and t2out are not supporte d in the 40-pin pdip package. figure 2. z8 encore! xp f64xx series in 40-pin dual inline package (pdip) pd5/txd1 pc4/mosi pa4/rxd0 pa5/txd0 pa6/scl pa7/sda pd6/c ts1 pc3/sck vss pd4/rxd1 pd3/de1 pc5/miso pa3/c ts0 pa2/de0 pa1/t0out pa0/t0in pc2/s s 14 0 vdd reset pc6/t2in dbg pc1/t1out vss pd1 pd0 pc0/t1in xout avss xin vref avdd pb2/ana2 pb3/ana3 pb7/ana7 pb0/ana0 pb1/ana1 pb4/ana4 20 21 pb6/ana6 pb5/ana5 5 10 15 35 30 25 vdd note:
ps019924-0113 p r e l i m i n a r y pin configurations z8 encore! xp ? f64xx series product specification 9 timer 3 is not available in the 44-pin plcc package. figure 3. z8 encore! xp f64xx series in 44 -pin plastic leaded chip carrier (plcc) pa7/sda pd6/c ts1 pc3/sck v ss v dd v ss pc7/t2out pc6/t2in dbg pa0/t0in pd2 pc2/s s reset v dd v ss v dd pd1 pd0 7 39 pc1/t1out x out pc0/t1in x in pa1/t0out pa2/de0 pa3/c ts0 pc5/miso pd3/de1 pd4/rxd1 pd5/txd1 pc4/mosi pa4/rxd0 pa5/txd0 pa6/scl av dd pb6/ana6 pb5/ana5 pb0/ana0 pb1/ana1 pb4/ana4 pb7/ana7 v ref pb2/ana2 pb3/ana3 av ss 64 0 1 17 29 28 18 12 23 34 note:
ps019924-0113 p r e l i m i n a r y pin configurations z8 encore! xp ? f64xx series product specification 10 timer 3 is not available in the 44-pin lqfp package. figure 4. z8 encore! xp f64xx series in 44-pin low-profile quad flat package (lqfp) pa7/sda pd6/c ts1 pc3/sck v ss v dd v ss pc7/t2out pc6/t2in dbg pa0/t0in pd2 pc2/s s reset v dd v ss v dd pd1 pd0 34 22 pc1/t1out x out pc0/t1in x in pa1/t0out pa2/de0 pa3/c ts0 pc5/miso pd3/de1 pd4/rxd1 pd5/txd1 pc4/mosi pa4/rxd0 pa5/txd0 pa6/scl av dd pb6/ana6 pb5/ana5 pb0/ana0 pb1/ana1 pb4/ana4 pb7/ana7 v ref pb2/ana2 pb3/ana3 av ss 33 23 44 12 11 1 28 39 17 6 note:
ps019924-0113 p r e l i m i n a r y pin configurations z8 encore! xp ? f64xx series product specification 11 figure 5. z8 encore! xp f64xx series in 64-pin low-profile quad flat package (lqfp) pa7/sda pd6/c ts1 pc3/sck pd7/rcout v ss pe5 pe6 pe7 v dd pa0/t0in pd2 pc2/s s reset v dd pe4 pe3 v ss pe2 49 32 pg3 pe1 v dd pe0 pa1/t0out pa2/de0 pa3/c ts0 v ss v dd pf7 pc5/miso pd4/rxd1 pd5/txd1 pc4/mosi v ss pb1/ana1 pb0/ana0 av dd ph0/ana8 ph1/ana9 pb4/ana4 pb7/ana7 pb6/ana6 pb5/ana5 pb3/ana3 48 1 pc7/t2out pc6/t2in dbg pc1/t1out pc0/t1in 17 pb2/ana2 v ref ph3/ana11 ph2/ana10 av ss 16 v ss pd1/t3out pd0/t3in x out x in 64 pd3/de1 v dd pa4/rxd0 pa5/txd0 pa6/scl 33 v ss 56 40 25 8
ps019924-0113 p r e l i m i n a r y pin configurations z8 encore! xp ? f64xx series product specification 12 figure 6. z8 encore! xp f64xx series in 68 -pin plastic leaded chip carrier (plcc) pa7/sda pd6/c ts1 pc3/sck pd7/rcout v ss pe5 pe6 pe7 v dd pa0/t0in pd2 pc2/s s reset v dd pe4 pe3 v ss pe2 10 60 pg3 pe1 v dd pe0 pa1/t0out pa2/de0 pa3/c ts0 v ss v dd pf7 pc5/miso pd4/rxd1 pd5/txd1 pc4/mosi v ss pb1/ana1 pb0/ana0 av dd ph0/ana8 pb4/ana4 pb7/ana7 pb6/ana6 pb5/ana5 pb3/ana3 9 27 pc7/t2out pc6/t2in dbg pc1/t1out pc0/t1in pb2/ana2 v ref ph3/ana11 ph2/ana10 av ss v ss v dd pd1/t3out pd0/t3in x out pd3/de1 v ss pa4/rxd0 pa5/txd0 v dd ph1/ana9 pa6/scl 61 v ss 44 av ss 43 x in 26 1 v dd 18 35 52
ps019924-0113 p r e l i m i n a r y pin configurations z8 encore! xp ? f64xx series product specification 13 figure 7. z8 encore! xp f64xx series in 80-pin quad flat package (qfp) pa7/sda pd6/c ts1 pc3/sck pd7/rcout pg0 v ss pg1 pg2 pe5 pa0/t0in pd2 pc2/s s pf6 reset v dd pf5 pf4 pf3 1 64 pe6 pe4 pe7 pe3 pa1/t0out pa2/de0 pa3/c ts0 v ss v dd pf7 pc5/miso pd4/rxd1 pd5/txd1 pc4/mosi v ss pb1/ana1 pb0/ana0 av dd ph0/ana8 pb4/ana4 pb7/ana7 pb6/ana6 pb5/ana5 pb3/ana3 80 25 v dd pg3 pg4 pg5 pg6 pb2/ana2 v ref ph3/ana11 ph2/ana10 av ss v ss pe2 pe1 pe0 v ss pd3/de1 v dd pa4/rxd0 pa5/txd0 pa6/scl v ss ph1/ana9 65 v dd 40 pf2 pg7 pf1 pc7/t2out pc6/t2in dbg pc1/t1out pc0/t1in pf0 v dd pd1/t3out pd0/t3in x out v ss 41 x in 24 5 10 15 20 30 35 45 50 55 60 70 75
ps019924-0113 p r e l i m i n a r y signal descriptions z8 encore! xp ? f64xx series product specification 14 signal descriptions table 3 lists the z8 encore! xp signals. to determine the available signals for a specific package style, see the pin configurations section on page 8. table 3. signal descriptions signal mnemonic i/o description general-purpose i/o ports a?h pa[7:0] i/o port a[7:0]. these pins are used for general-purpose i/o and support 5 v-toler- ant inputs. pb[7:0] i/o port b[7:0]. these pins are used for general-purpose i/o. pc[7:0] i/o port c[7:0]. these pins are used for general-purpose i/o. these pins are used for general-purpose i/o and support 5 v-tolerant inputs pd[7:0] i/o port d[7:0]. these pins are used for general-purpose i/o. these pins are used for general-purpose i/o and support 5 v-tolerant inputs pe[7:0] i/o port e[7:0]. these pins are used fo r general-purpose i/o. these pins are used for general-purpose i/o and support 5 v-tolerant inputs. pf[7:0] i/o port f[7:0]. these pins are used fo r general-purpose i/o. these pins are used for general-purpose i/o and support 5 v-tolerant inputs. pg[7:0] i/o port g[7:0]. these pins are used fo r general-purpose i/o. these pins are used for general-purpose i/o and support 5 v-tolerant inputs. ph[3:0] i/o port h[3:0]. these pins are used for general-purpose i/o. i 2 c controller scl o serial clock. this is the output clock for the i 2 c. this pin is multiplexed with a general-purpose i/o pin. when the general-purpose i/o pin is configured for alternate function to enable the sc l function, this pin is open-drain. sda i/o serial data. this open-drain pin transfers data between the i 2 c and a slave. this pin is multiplexed with a general- purpose i/o pin. when the general-pur- pose i/o pin is configured for alternate function to enable the sda function, this pin is open-drain. spi controller ss i/o slave select. this signal can be an output or an input. if the z8 encore! xp f64xx series is the spi master, this pin may be configured as the slave select output. if the z8 encore! xp f64xx series is the spi slave, this pin is the input slave select. it is multiplexed with a general-purpose i/o pin. sck i/o spi serial clock. the spi master supplies this pin. if the z8 encore! xp f64xx series is the spi master, this pin is an output. if the z8 encore! xp f64xx series is the spi slave, this pin is an input. it is multiplexed with a general-pur- pose i/o pin.
ps019924-0113 p r e l i m i n a r y signal descriptions z8 encore! xp ? f64xx series product specification 15 spi controller (continued) mosi i/o master-out/slave-in. this signal is the data output from the spi master device and the data input to the spi slave devi ce. it is multiplexe d with a general-pur- pose i/o pin. miso i/o master-in/slave-out. th is pin is the data input to the spi master device and the data output from the spi slav e device. it is multiplexed with a ? general-purpose i/o pin. uart controllers txd0/txd1 o transmit data. these signals are the transmit outputs from the uarts. the txd signals are multiplexed with general-purpose i/o pins. rxd0/rxd1 i receive data. these signals are the receiver inputs for the uarts and irdas. the r x d signals are multiplexed with general-purpose i/o pins. cts0 /c ts1 i clear to send. these signals are control inputs for the uarts. the cts sig- nals are multiplexed with general-purpose i/o pins. de0/de1 o driver enable. this signal allows autom atic control of extern al rs-485 drivers. this signal is approximately the inverse of the transmit empty (txe) bit in the uart status 0 register. the de signal may be used to ensure an external rs-485 driver is enabled when da ta is transmitted by the uart. timers t0out/ t1out/ t2out/ t3out o timer output 0-3. these signals are output pins from the timers. the timer output signals are multiplexed with ge neral-purpose i/o pins. t3out is not available in 44-pin package devices. t0in/t1in/ ? t2in/t3in i timer input 0-3. these signals are used as the capture, gating and counter inputs. the timer input signals are mult iplexed with general-purpose i/o pins. t3in is not available in 44-pin package devices. analog ana[11:0] i analog input. these signals are inputs to the adc. the adc analog inputs are multiplexed with general-purpose i/o pins. v ref i analog-to-digital converter reference voltage input. the v ref pin must be left unconnected (or capacitively coupled to analog ground) if the internal voltage reference is selected as the adc reference voltage. table 3. signal descriptions (continued) signal mnemonic i/o description
ps019924-0113 p r e l i m i n a r y signal descriptions z8 encore! xp ? f64xx series product specification 16 oscillators x in i external crystal input. this is the inpu t pin to the crystal oscillator. a crystal can be connected between it and the x out pin to form the oscillator. this sig- nal is usable with external rc networks and an external clock driver. x out o external crystal output. this pin is the output of the crystal oscillator. a crystal can be connected between it and the x in pin to form the oscillator. when the system clock is referred to in this manual , it refers to the frequency of the sig- nal at this pin. this pin must be le ft unconnected when not using a crystal. rc out o rc oscillator outp ut. this signal is the output of the rc oscillator. it is multi- plexed with a general-purpose i/o pin. this signal must be left unconnected when not using a crystal. on-chip debugger dbg i/o debug. this pin is the control and data input and output to and from the on- chip debugger. this pin is open-drain. caution: for operation of the on-chip debugger, all power pins (v dd and av dd ) must be supplied with power and all ground pins (v ss and av ss ) must be properly grounded. the dbg pin is open-drain and must have an external pull-up resistor to ensure proper operation. reset reset i reset. generates a reset when asserted (driven low). power supply v dd i power supply. av dd i analog power supply. v ss i ground. av ss i analog ground. table 3. signal descriptions (continued) signal mnemonic i/o description
ps019924-0113 p r e l i m i n a r y pin characteristics z8 encore! xp ? f64xx series product specification 17 pin characteristics table 4 lists the characteristics for each pin available on the z8 encore! xp f64xx series products and the data is sorted alphab etically by the pi n symbol mnemonic. table 4. pin characteristics of the z8 encore! xp f64xx series symbol mnemonic direction reset direction active low or active high tri-state output internal pull-up or pull-down schmitt- trigger input open-drain output av ss n/a n/a n/a n/a no no n/a av dd n/a n/a n/a n/a no no n/a dbg i/o i n/a yes no yes yes v ss n/a n/a n/a n/a no no n/a pa[7:0] i/o i n/a yes no yes yes, ? programmable pb[7:0] i/o i n/a yes no yes yes, ? programmable pc[7:0] i/o i n/a yes no yes yes, ? programmable pd[7:0] i/o i n/a yes no yes yes, ? programmable pe7:0] i/o i n/a yes no yes yes, ? programmable pf[7:0] i/o i n/a yes no yes yes, ? programmable pg[7:0] i/o i n/a yes no yes yes, ? programmable ph[3:0] i/o i n/a yes no yes yes, ? programmable reset i i low n/a pull-up yes n/a v dd n/a n/a n/a n/a no no n/a x in i i n/a n/a no no n/a x out o o n/a yes, in stop mode no no no note: x represents integer 0, 1,... to indicate multiple pins with symbol mnemonics that differ only by the integer.
ps019924-0113 p r e l i m i n a r y address space z8 encore! xp ? f64xx series product specification 18 address space the ez8 cpu can access three distinct address spaces: ? the register file contains addresses for the general-purpose registers and the ez8 cpu, peripheral and general-purp ose i/o port control registers ? the program memory contains addresses for all memory locations having executable code and/or data ? the data memory consists of the addresses fo r all memory locations that hold only data ? these three address spaces are covered briefl y in the following secti ons. for more infor- mation about the ez8 cpu and its address space, refer to the ez8 cpu core user manual (um0128) , which is available for download on www.zilog.com . register file the register file address space in the z8 en core! xp f64xx series is 4 kb (4096 bytes). the register file is composed of two sectio ns: control registers and general-purpose reg- isters. when instructions are executed, registers are read from when defined as sources and written to when defined as destinations. the architecture of th e ez8 cpu allows all general-purpose registers to function as accumulators, address pointers, index registers, stack areas, or scratch pad memory. the upper 256 bytes of the 4 kb register file address space are reserved for control of the ez8 cpu, the on-chip peripherals, and the i/o ports. these registers are located at addresses from f00h to fffh . some of the addresses within the 256-byte control register section are reserved (unavailable). reading from an reserved register file addresses returns an undefined value. writing to re served register file addresses is not recom- mended and can produce unpredictable results. the on-chip ram always begins at address 00 0h in the register file address space. the z8 encore! xp f64xx series provide 2 kb to 4 kb of on-chip ram depending upon the device. reading from register file addresses outside the available ram addresses (and not within the control register address space) returns an unde fined value. writing to these register file addresses produces no effect. to determine the amount of ram available for the specific z8 encore! xp f64xx series device, see the part selection guide section on page 2.
ps019924-0113 p r e l i m i n a r y program memory z8 encore! xp ? f64xx series product specification 19 program memory the ez8 cpu supports 64 kb of program memory address space. the z8 encore! xp f64xx series contains 16 kb to 64 kb of on-chip flash in the program memory address space, depending upon the device. reading from program memory addresses outside the available flash memory addresses returns ffh . writing to these unimplemented program memory addresses produces no effect. table 5 describes the program memory maps for the z8 encore! xp f64xx series products. table 5. z8 encore! xp f64xx series program memory maps program memory address (hex) function z8f162x products 0000-0001 option bits 0002-0003 reset vector 0004-0005 wdt interrupt vector 0006-0007 illegal instruction trap 0008-0037 interrupt vectors* 0038-3fff program memory z8f242x products 0000-0001 option bits 0002-0003 reset vector 0004-0005 wdt interrupt vector 0006-0007 illegal instruction trap 0008-0037 interrupt vectors* 0038-5fff program memory z8f322x products 0000-0001 option bits 0002-0003 reset vector 0004-0005 wdt interrupt vector 0006-0007 illegal instruction trap 0008-0037 interrupt vectors* 0038-7fff program memory z8f482x products 0000-0001 option bits 0002-0003 reset vector 0004-0005 wdt interrupt vector note: *see table 23 on page 48 for a list of the interrupt vectors.
ps019924-0113 p r e l i m i n a r y data memory z8 encore! xp ? f64xx series product specification 20 data memory the z8 encore! xp f64xx series does not use the ez8 cpu?s 64 kb data memory address space. information area table 6 describes the z8 encore! xp f64xx series? information area. this 512-byte information area is accessed by se tting bit 7 of the page select register to 1. when access is enabled, the information ar ea is mapped into program memory and overlays the 512 bytes at addresses fe00h to ffffh . when the information area access is enabled, execu- tion of the ldc and ldci instructions from these program memory addresses return the information area data rather than the prog ram memory data. reads of these addresses through the on-chip debugger also returns th e information area data. execution of code from these addresses continues to correctly use program memory. access to the informa- tion area is read-only. 0006-0007 illegal instruction trap 0008-0037 interrupt vectors* 0038-bfff program memory z8f642x products 0000-0001 option bits 0002-0003 reset vector 0004-0005 wdt interrupt vector 0006-0007 illegal instruction trap 0008-0037 interrupt vectors* 0038-ffff program memory table 5. z8 encore! xp f64xx series program memory maps (continued) program memory address (hex) function note: *see table 23 on page 48 for a list of the interrupt vectors.
ps019924-0113 p r e l i m i n a r y information area z8 encore! xp ? f64xx series product specification 21 table 6. z8 encore! xp f64xx series information area map program memory address (hex) function fe00h?fe3fh reserved fe40h?fe53h part number ? 20-character ascii alphanumeric code ? left-justified and filled with zeros (ascii null character) fe54h?ffffh reserved
ps019924-0113 p r e l i m i n a r y register file address map z8 encore! xp ? f64xx series product specification 22 register file address map table 7 provides the address map for the regist er file of the z8 encore! xp f64xx series products. not all devices and package styles in the z8 encore! xp f64xx series support timer 3 and all of the gpio ports. consider registers for unimplemented peripherals to be reserved. table 7. z8 encore! xp f64xx series register file address map address (hex) register description mnemonic reset (hex) page general-purpose ram 000?eff general-purpose register file ram ? xx timer 0 f00 timer 0 high byte t0h 00 72 f01 timer 0 low byte t0l 01 72 f02 timer 0 reload high byte t0rh ff 74 f03 timer 0 reload low byte t0rl ff 74 f04 timer 0 pwm high byte t0pwmh 00 75 f05 timer 0 pwm low byte t0pwml 00 75 f06 timer 0 control 0 t0ctl0 00 76 f07 timer 0 control 1 t0ctl1 00 77 timer 1 f08 timer 1 high byte t1h 00 72 f09 timer 1 low byte t1l 01 72 f0a timer 1 reload high byte t1rh ff 74 f0b timer 1 reload low byte t1rl ff 74 f0c timer 1 pwm high byte t1pwmh 00 75 f0d timer 1 pwm low byte t1pwml 00 75 f0e timer 1 control 0 t1ctl0 00 76 f0f timer 1 control 1 t1ctl1 00 77 timer 2 f10 timer 2 high byte t2h 00 72 f11 timer 2 low byte t2l 01 72 f12 timer 2 reload high byte t2rh ff 74 f13 timer 2 reload low byte t2rl ff 74 note: xx = undefined.
ps019924-0113 p r e l i m i n a r y register file address map z8 encore! xp ? f64xx series product specification 23 timer 2 (continued) f14 timer 2 pwm high byte t2pwmh 00 75 f15 timer 2 pwm low byte t2pwml 00 75 f16 timer 2 control 0 t2ctl0 00 76 f17 timer 2 control 1 t2ctl1 00 77 timer 3 (unavailable in the 44-pin package) f18 timer 3 high byte t3h 00 72 f19 timer 3 low byte t3l 01 72 f1a timer 3 reload high byte t3rh ff 74 f1b timer 3 reload low byte t3rl ff 74 f1c timer 3 pwm high byte t3pwmh 00 75 f1d timer 3 pwm low byte t3pwml 00 75 f1e timer 3 control 0 t3ctl0 00 76 f1f timer 3 control 1 t3ctl1 00 77 20?3f reserved ? xx uart 0 f40 uart0 transmit data u0txd xx 98 uart0 receive data u0rxd xx 99 f41 uart0 status 0 u0stat0 0000011xb 100 f42 uart0 control 0 u0ctl0 00 102 f43 uart0 control 1 u0ctl1 00 102 f44 uart0 status 1 u0stat1 00 100 f45 uart0 address compare register u0addr 00 105 f46 uart0 baud rate high byte u0brh ff 105 f47 uart0 baud rate low byte u0brl ff 105 uart 1 f48 uart1 transmit data u1txd xx 98 uart1 receive data u1rxd xx 99 f49 uart1 status 0 u1stat0 0000011xb 100 f4a uart1 control 0 u1ctl0 00 102 f4b uart1 control 1 u1ctl1 00 102 f4c uart1 status 1 u1stat1 00 100 table 7. z8 encore! xp f64xx series register file address map (continued) address (hex) register description mnemonic reset (hex) page note: xx = undefined.
ps019924-0113 p r e l i m i n a r y register file address map z8 encore! xp ? f64xx series product specification 24 uart 1 (continued) f4d uart1 address compare register u1addr 00 105 f4e uart1 baud rate high byte u1brh ff 105 f4f uart1 baud rate low byte u1brl ff 105 i 2 c f50 i 2 c data i2cdata 00 141 f51 i 2 c status i2cstat 80 142 f52 i 2 c control i2cctl 00 144 f53 i 2 c baud rate high byte i2cbrh ff 145 f54 i 2 c baud rate low byte i2cbrl ff 145 f55 i 2 c diagnostic state i2cdst c0 147 f56 i 2 c diagnostic control i2cdiag 00 149 f57?f5f reserved ? xx serial peripheral interface (spi) f60 spi data spidata xx 121 f61 spi control spictl 00 122 f62 spi status spistat 01 123 f63 spi mode spimode 00 125 f64 spi diagnostic state spidst 00 126 f65 reserved ? xx f66 spi baud rate high byte spibrh ff 126 f67 spi baud rate low byte spibrl ff 126 f68?f6f reserved ? xx analog-to-digital converter f70 adc control adcctl 20 165 f71 reserved ? xx f72 adc data high byte adcd_h xx 167 f73 adc data low bits adcd_l xx 168 f74?faf reserved ? xx dma 0 fb0 dma0 control dma0ctl 00 153 fb1 dma0 i/o address dma0io xx 154 table 7. z8 encore! xp f64xx series register file address map (continued) address (hex) register description mnemonic reset (hex) page note: xx = undefined.
ps019924-0113 p r e l i m i n a r y register file address map z8 encore! xp ? f64xx series product specification 25 dma 0 (continued) fb2 dma0 end/start address high nibble dma0h xx 155 fb3 dma0 start address low byte dma0start xx 156 fb4 dma0 end address low byte dma0end xx 156 dma 1 fb8 dma1 control dma1ctl 00 153 fb9 dma1 i/o address dma1io xx 154 fba dma1 end/start address high nibble dma1h xx 155 fbb dma1 start address low byte dma1start xx 156 fbc dma1 end address low byte dma1end xx 156 dma adc fbd dma_adc address dmaa_addr xx 157 fbe dma_adc control dmaactl 00 158 fbf dma_adc status dmaastat 00 159 interrupt controller fc0 interrupt request 0 irq0 00 51 fc1 irq0 enable high bit irq0enh 00 55 fc2 irq0 enable low bit irq0enl 00 55 fc3 interrupt request 1 irq1 00 53 fc4 irq1 enable high bit irq1enh 00 56 fc5 irq1 enable low bit irq1enl 00 56 fc6 interrupt request 2 irq2 00 54 fc7 irq2 enable high bit irq2enh 00 58 fc8 irq2 enable low bit irq2enl 00 58 fc9?fcc reserved ? xx fcd interrupt edge select irqes 00 60 fce interrupt port select irqps 00 60 fcf interrupt control irqctl 00 61 gpio port a fd0 port a address paaddr 00 40 fd1 port a control pactl 00 41 fd2 port a input data pain xx 46 table 7. z8 encore! xp f64xx series register file address map (continued) address (hex) register description mnemonic reset (hex) page note: xx = undefined.
ps019924-0113 p r e l i m i n a r y register file address map z8 encore! xp ? f64xx series product specification 26 gpio port a (continued) fd3 port a output data paout 00 46 gpio port b fd4 port b address pbaddr 00 40 fd5 port b control pbctl 00 41 fd6 port b input data pbin xx 46 fd7 port b output data pbout 00 46 gpio port c fd8 port c address pcaddr 00 40 fd9 port c control pcctl 00 41 fda port c input data pcin xx 46 fdb port c output data pcout 00 46 gpio port d fdc port d address pdaddr 00 40 fdd port d control pdctl 00 41 fde port d input data pdin xx 46 fdf port d output data pdout 00 46 gpio port e fe0 port e address peaddr 00 40 fe1 port e control pectl 00 41 fe2 port e input data pein xx 46 fe3 port e output data peout 00 46 gpio port f fe4 port f address pfaddr 00 40 fe5 port f control pfctl 00 41 fe6 port f input data pfin xx 46 fe7 port f output data pfout 00 46 gpio port g fe8 port g address pgaddr 00 40 fe9 port g control pgctl 00 41 fea port g input data pgin xx 46 feb port g output data pgout 00 46 table 7. z8 encore! xp f64xx series register file address map (continued) address (hex) register description mnemonic reset (hex) page note: xx = undefined.
ps019924-0113 p r e l i m i n a r y register file address map z8 encore! xp ? f64xx series product specification 27 gpio port h fec port h address phaddr 00 40 fed port h control phctl 00 41 fee port h input data phin xx 46 fef port h output data phout 00 46 watchdog timer ff0 watchdog timer c ontrol wdtctl xxx00000b 83 ff1 watchdog timer reload upper byte wdtu ff 85 ff2 watchdog timer reload high byte wdth ff 85 ff3 watchdog timer reload low byte wdtl ff 85 ff4?ff7 reserved ? xx flash memory controller ff8 flash control fctl 00 175 ff8 flash status fstat 00 177 ff9 page select fps 00 177 ff9 (if enabled) flash sector protect fprot 00 178 ffa flash programming frequency high byte ffreqh 00 179 ffb flash programming frequency low byte ffreql 00 179 ez8 cpu ffc flags ? xx refer to the ez8 cpu core user manual (um0128) ffd register pointer rp xx ffe stack pointer high byte sph xx fff stack pointer low byte spl xx table 7. z8 encore! xp f64xx series register file address map (continued) address (hex) register description mnemonic reset (hex) page note: xx = undefined.
ps019924-0113 p r e l i m i n a r y reset and stop mode recovery z8 encore! xp ? f64xx series product specification 28 reset and stop mode recovery the reset controller within the z8 encore! xp f64xx series controls reset and stop mode recovery operation. in typical operat ion, the following events cause a reset to occur: ? power-on reset ? voltage brown-out ? watchdog timer time-out (whe n configured via the wdt_r es option bit to initiate a reset) ? external reset pin assertion ? on-chip debugger initiated reset (ocdctl[0] set to 1) ? when the z8 encore! xp f64xx series devices are in stop mode, a stop mode recovery is initiated by either of the following events: ? watchdog timer time-out ? gpio port input pin transition on an enabled stop mode recovery source ? dbg pin driven low reset types the z8 encore! xp f64xx series provides two different types of reset operation (system reset and stop mode recovery). the type of reset is a function of both the current operat- ing mode of the z8 encore! xp f64xx series devices and the source of the reset. table 8 lists the types of reset and their operating characteristics. table 8. reset and stop mode recovery characteristics and latency reset type reset characteristics and latency control registers ez8 cpu reset latency (delay) system reset reset (as applic able) reset 66 wdt oscillator cy cles + 16 system clock cycles stop mode recovery unaffected, except wdt_ctl register reset 66 wdt oscillator cycles + 16 system clock cycles
ps019924-0113 p r e l i m i n a r y reset sources z8 encore! xp ? f64xx series product specification 29 system reset during a system reset, the z8 encore! xp f6 4xx series devices are held in reset for 66 cycles of the watchdog timer oscillator followe d by 16 cycles of the system clock. at the beginning of reset, all gpio pi ns are configured as inputs. during reset, the ez8 cpu and on-chip peripher als are idle; however, the on-chip crystal oscillator and watchdog timer oscillator continue to run. the system clock begins operat- ing following the watchdog timer oscillato r cycle count. the ez8 cpu and on-chip peripherals remain idle through th e 16 cycles of th e system clock. upon reset, control registers w ithin the register file that have a defined reset value are loaded with their reset values. other control registers (including the stack pointer, regis- ter pointer, and flags) and general-purpo se ram are undefined following reset. the ez8 cpu fetches the reset vector at program memory addresses 0002h and 0003h and loads that value into the program counter. prog ram execution begins at the reset vector address. reset sources table 9 lists the reset sources as a function of the operating mode. the text following pro- vides more detailed informatio n about the individual rese t sources. a power-on reset/ voltage brown-out event always takes prior ity over all other possible reset sources to ensure a full system reset occurs. table 9. reset sources and resulting reset type operating mode reset source reset type normal or halt modes power-on reset/voltage brown- out system reset watchdog timer time-out ? when configured for reset system reset reset pin assertion system reset on-chip debugger initiated reset ? (ocdctl[0] set to 1) system reset except the on-chip debugger is unaffected by the reset stop mode power-on reset/voltage brown- out system reset reset pin assertion system reset dbg pin driven low system reset
ps019924-0113 p r e l i m i n a r y reset sources z8 encore! xp ? f64xx series product specification 30 power-on reset each device in the z8 encore! xp f64xx series contains an internal power-on reset cir- cuit. the por circuit monitors the supply voltage and holds th e device in the reset state until the supply voltage reaches a safe operatin g level. after the supply voltage exceeds the por voltage threshold (v por ), the por counter is enabled and counts 66 cycles of the watchdog timer oscillator. after the po r counter times out, the xtal counter is enabled to count a total of 16 system clock pu lses. the devices are held in the reset state until both the por counter and xtal counter ha ve timed out. after the z8 encore! xp f64xx series devices exit the power-on reset state, the ez8 cpu fetches the reset vector. following power-on reset, the por status bit in the watchdog timer control (wdtctl) register is set to 1. figure 8 displays power-on reset opera tion. for the por threshold voltage (v por ), see the electrical characteristics chapter on page 200. figure 8. power-on reset operation v cc = 0.0 v v cc = 3.3v v por v vbo primary oscillator internal reset signal program execution oscillator start-up xtal wdt clock por counter delay counter delay
ps019924-0113 p r e l i m i n a r y reset sources z8 encore! xp ? f64xx series product specification 31 voltage brown-out reset the devices in the z8 encore! xp f64xx series provide low voltage brown-out protec- tion. the vbo circuit senses when the supply vol tage drops to an unsa fe level (below the vbo threshold voltage) and forces the device into the reset state. while the supply volt- age remains below the power-on reset voltage threshold (v por ), the vbo block holds the device in the reset state. after the supply voltage again exceeds the po wer-on reset voltage threshold, the devices progress through a full system reset sequence, as described in the power-on reset section. following power-on reset, the por status bit in the watchdog timer control (wdtctl) register is set to 1. figure 9 di splays voltage brown-ou t operation. for the vbo and por threshold voltages (v vbo and v por ), see the electrical characteristics chapter on page 200. the voltage brown-out circuit can be either enabled or disabled during stop mode. operation during stop mode is set by the vbo_ao option bit. for information about configuring vbo_ao, see the option bits chapter on page 180. figure 9. voltage brown-out reset operation v cc = 3.3v v por v vbo internal reset signal program execution program execution voltage brown-out v cc = 3.3v primary oscillator wdt clock xtal por counter delay counter delay
ps019924-0113 p r e l i m i n a r y stop mode recovery z8 encore! xp ? f64xx series product specification 32 watchdog timer reset if the device is in normal or halt mode, th e watchdog timer can in itiate a system reset at time-out if the wdt_res option bit is se t to 1. this capability is the default ? (unprogrammed) setting of th e wdt_res option bit. the wdt status bit in the wdt control register is set to si gnify that the reset was initiated by the watchdog timer. external pin reset the reset pin has a schmitt-triggered input, an internal pull-up, an analog filter and a digital filter to reject noise. once the reset pin is asserted for at least 4 system clock cycles, the devices progress through th e system reset sequence. while the reset input pin is asserted low, the z8 encore! xp f64xx series devices continue to be held in the reset state. if the reset pin is held low beyond the syst em reset time-out, the devices exit the reset state immediately following reset pin deassertion. following a system reset initiated by the external reset pin, the ext status bit in the watchdog timer con- trol (wdtctl) register is set to 1. on-chip debugger initiated reset a power-on reset can be initiated using the on-chip debugger by se tting the rst bit in the ocd control register. the on-chip debugger block is not reset but the rest of the chip goes through a normal system reset. th e rst bit automatically clears during the sys- tem reset. following the system reset the por bit in the wdt control register is set. stop mode recovery stop mode is entered by the ez8 executing a stop instruction. for detailed stop mode information, see the low-power modes chapter on page 34. during stop mode recovery, the devices are held in reset for 66 cycles of the watchdog timer oscillator followed by 16 cycles of the system clock. stop mode recovery only affects the contents of the watchdog timer control register. stop mode recovery does not affect any other values in the reg- ister file, including the stack pointer, register pointer, flags, peripheral control registers, and general-purpose ram. the ez8 cpu fetches the reset vector at program memory addresses 0002h and 0003h and loads that value into the program counte r. program execution begins at the reset vec- tor address. following stop mode recovery, the stop bit in the watchdog timer control register is set to 1. table 10 lists the stop mode recovery sources and resulting actions.
ps019924-0113 p r e l i m i n a r y stop mode recovery z8 encore! xp ? f64xx series product specification 33 stop mode recovery using watchdog timer time-out if the watchdog timer times out during stop mode, the device undergoes a stop mode recovery sequence. in the wa tchdog timer control register, the wdt and stop bits are set to 1. if the watchdog timer is configured to generate an interrupt upon time-out and the z8 encore! xp f64xx series devices are c onfigured to respond to interrupts, the ez8 cpu services the watchdog timer interrupt request following the normal stop mode recovery sequence. stop mode recovery using a gp io port pin transition halt each of the gpio port pins may be configured as a stop mode recovery input source. on any gpio pin enabled as a stop mode recove ry source, a change in the input pin value (from high to low or from low to high) initiates stop mode recovery. the gpio stop mode recovery signals are filtered to reject pul ses less than 10 ns (typical) in duration. in the watchdog timer control regist er, the stop bit is set to 1. in stop mode, the gpio port input data registers (pxin) are disabled. the port input data registers record the port transition only if the signal stays on the port pin through the end of the stop mode recovery delay. th us, short pulses on th e port pin can initiate stop mode recovery without being written to th e port input data regi ster or without ini- tiating an interrupt (if enabled for that pin). table 10. stop mode recovery sources and resulting action operating mode stop mode recovery source action stop mode watchdog timer time-out when configured for reset. stop mode recovery. watchdog timer time-out when configured for interrupt. stop mode recovery followed by interrupt (if interrupts are enabled). data transition on any gpio port pin enabled as a stop mode recovery source. stop mode recovery. caution:
ps019924-0113 p r e l i m i n a r y low-power modes z8 encore! xp ? f64xx series product specification 34 low-power modes the z8 encore! xp f64xx series products contain power-saving features. the highest level of power reduction is provided by stop mode. the next level of power reduction is provided by halt mode. stop mode execution of the ez8 cpu?s stop instruction places the device into stop mode. in stop mode, the operating characteristics are: ? primary crystal oscillator is stopped; the x in pin is driven high and the x out pin is driven low ? system clock is stopped ? ez8 cpu is stopped ? program counter (pc) stops incrementing ? the watchdog timer and its in ternal rc oscillator continue to operate, if enabled for operation during stop mode ? the voltage brown-out protection circuit contin ues to operate, if enabled for operation in stop mode using the associated option bit ? all other on-chip peripherals are idle ? to minimize current in stop mode, all gpio pins that are configured as digital inputs must be driven to one of the supply rails (v cc or gnd), the voltage brown-out protection must be disabled, and the watchdog timer mu st be disabled. the devices can be brought out of stop mode using stop mode recove ry. for more information about stop mode recovery, see the reset and stop mode recovery chapter on page 28. stop mode must not be used when driving the z8 encore! xp f64xx series devices with an external clock driver source. caution:
ps019924-0113 p r e l i m i n a r y halt mode z8 encore! xp ? f64xx series product specification 35 halt mode execution of the ez8 cpu?s halt instructio n places the device into halt mode. in halt mode, the operating characteristics are: ? primary crystal oscillator is en abled and continues to operate ? system clock is enabled and continues to operate ? ez8 cpu is stopped ? program counter stops incrementing ? watchdog timer?s internal rc oscillator continues to operate ? the watchdog timer continue s to operate, if enabled ? all other on-chip peripherals continue to operate ? the ez8 cpu can be brought out of halt mode by any of the following operations: ? interrupt ? watchdog timer time-out (interrupt or reset) ? power-on reset ? voltage brown-out reset ? external reset pin assertion ? to minimize current in halt mode, all gpio pins which are configured as inputs must be driven to one of the supply rails (v cc or gnd).
ps019924-0113 p r e l i m i n a r y general-purpose i/o z8 encore! xp ? f64xx series product specification 36 general-purpose i/o the z8 encore! xp f64xx series products support a maximum of seven 8-bit ports (ports a?g) and one 4-bit port (port h) for general-purpose input/output (gpio) operations. each port consists of control and data regist ers. the gpio control registers are used to determine data direction, op en-drain, output drive current and alternate pin functions. each port pin is individually programmable. all ports (except b and h) support 5 v-toler- ant inputs. gpio port availability by device table 11 lists the port pins available with each device and package type. table 11. port availability by device and package type device packages port a port b port c port d port e port f port g port h z8x162140-pin [7:0][7:0][7:0][6:3,1:0]???? 44-pin [7:0][7:0][7:0][6:0]???? z8x1622 64- and 68-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7] [3] [3:0] z8x242140-pin [7:0][7:0][7:0][6:3,1:0]???? 44-pin [7:0][7:0][7:0][6:0]???? z8x2422 64- and 68-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7] [3] [3:0] z8x322140-pin [7:0][7:0][7:0][6:3,1:0]???? 44-pin [7:0][7:0][7:0][6:0]???? z8x3222 64- and 68-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7] [3] [3:0] z8x482140-pin [7:0][7:0][7:0][6:3,1:0]???? 44-pin [7:0][7:0][7:0][6:0]???? z8x4822 64- and 68-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7] [3] [3:0] z8x4823 80-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7:0] [7:0] [3:0] z8x642140-pin [7:0][7:0][7:0][6:3,1:0]???? 44-pin [7:0][7:0][7:0][6:0]???? z8x6422 64- and 68-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7] [3] [3:0] z8x6423 80-pin [7:0] [7:0] [7:0] [7:0] [7:0] [7:0] [7:0] [3:0]
ps019924-0113 p r e l i m i n a r y architecture z8 encore! xp ? f64xx series product specification 37 architecture figure 10 displays a simplified block diagram of a gpio port pin. in this figure, the ability to accommodate alternate functi ons and variable port current drive strength are not illus- trated. gpio alternate functions many of the gpio port pins can be used as bo th general-purpose i/o and to provide access to on-chip peripheral functions such as th e timers and serial communication devices. the port a?h alternate function subr egisters configure these pins for either general-purpose i/o or alternate function operation. when a pin is configured for alte rnate function, control of the port pin direction (input/output) is passed from the port a?h data direction regis- ters to the alternate function as signed to this pin. table 12 lists the alternate functions associated with each port pin. figure 10. gpio port pin block diagram dq dq gnd v dd port output control port data direction port output data register port input data register port pin data bus system clock system clock schmitt-trigger
ps019924-0113 p r e l i m i n a r y gpio alternate functions z8 encore! xp ? f64xx series product specification 38 table 12. port alternate function mapping port pin mnemonic alternate function description port a pa0 t0in timer 0 input pa1 t0out timer 0 output pa2 de0 uart 0 driver enable pa3 cts0 uart 0 clear to send pa4 rxd0/irrx0 uart 0/irda 0 receive data pa5 txd0/irtx0 uart 0/irda 0 transmit data pa6 scl i 2 c clock (automatically open-drain) pa7 sda i 2 c data (automatically open-drain) port b pb0 ana0 adc analog input 0 pb1 ana1 adc analog input 1 pb2 ana2 adc analog input 2 pb3 ana3 adc analog input 3 pb4 ana4 adc analog input 4 pb5 ana5 adc analog input 5 pb6 ana6 adc analog input 6 pb7 ana7 adc analog input 7 port c pc0 t1in timer 1 input pc1 t1out timer 1 output pc2 ss spi slave select pc3 sck spi serial clock pc4 mosi spi master out/slave in pc5 miso spi master in/slave out pc6 t2in timer 2 in pc7 t2out timer 2 out port d pd0 t3in timer 3 in (unavailable in the 44-pin package) pd1 t3out timer 3 out (unavailable in the 44-pin package) pd2 n/a no alternate function pd3 de1 uart 1 driver enable pd4 rxd1/irrx1 uart 1/irda 1 receive data pd5 txd1/irtx1 uart 1/irda 1 transmit data pd6 cts1 uart 1 clear to send pd7 rcout watchdog timer rc oscillator output port e pe[7:0] n/a no alternate functions
ps019924-0113 p r e l i m i n a r y gpio interrupts z8 encore! xp ? f64xx series product specification 39 gpio interrupts many of the gpio port pins can be used as interrupt sources. some port pins may be con- figured to generate an interrupt request on eith er the rising edge or falling edge of the pin input signal. other port pin interrupts generate an interrupt when any edge occurs (both rising and falling). for more information ab out interrupts using the gpio pins, see the interrupt controller chapter on page 47 . gpio control register definitions four registers for each port provide access to gpio control, input data, and output data. table 13 lists these port registers. use the port a?h address and control registers together to provide access to subregiste rs for port configuration and control. port f pf[7:0] n/a no alternate functions port g pg[7:0] n/a no alternate functions port h ph0 ana8 adc analog input 8 ph1 ana9 adc analog input 9 ph2 ana10 adc analog input 10 ph3 ana11 adc analog input 11 table 13. gpio port registers and subregisters port register mnemonic port register name p x addr port a ? h address register (selects subregisters) p x ctl port a ? h control register (provides access to subregisters) p x in port a ? h input data register p x out port a ? h output data register port subregister mnemonic port register name p x dd data direction p x af alternate function p x oc output control (open-drain) pxdd high drive enable p x smre stop mode recovery source enable table 12. port alternate function mapping (continued) port pin mnemonic alternate function description
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 40 port a?h address registers the port a?h address registers, shown in table 14, select the gpio port functionality accessible through the port a?h control re gisters. the port a?h address and control registers combine to provide acc ess to all gpio port control. table 14. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech bit description [7:0] ? paddr port address this port address selects one of the subregis ters accessible through the port a?h control registers. 00h = no function. provides some protection against accidental port reconfiguration. 01h = data direction. 02h = alternate function. 03h = output control (open-drain). 04h = high drive enable. 05h = stop mode recovery source enable. 06h?ffh = no function.
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 41 port a?h control registers the port a?h control registers, shown in ta ble 15, set the gpio port operation. the value in the corresponding port a?h address re gister determines the control subregisters accessible using the port a?h control register. port a?h data direction subregisters the port a?h data direction subregister, show n in table 16, is accessed through the port a?h control register by writing 01h to the port a?h address register. table 15. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh bit description [7:0] ? pctl port control the port control register provides access to all subregisters that configure the gpio port operation. table 16. port a ? h data direction subregisters bit 7 6 5 4 3 2 1 0 field dd7 dd6 dd5 dd4 dd3 dd2 dd1 dd0 reset 1 r/w r/w address see note. note: if a 01h exists in the port a?h address register, it is accessible through the port a?h control register. bit description [7:0] ? ddx data direction these bits control the direction of the associated port pin. port alternate function operation overrides the data direction register setting. 0 = output. data in the port a?h output data register is driven onto the port pin. 1 = input. the port pin is sampled and the value written into the port a?h input data register. the output driver is tri-stated. note: x indicates register bits in the range [7:0].
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 42 port a?h alternate function subregisters the port a?h alternate functio n subregister, shown in table 17, is accessed through the ? port a?h control register by writing 02h to the port a?h address register. the port a? h alternate function subregisters select the a lternate functions for the selected pins. to determine the alternate fu nction associated with e ach port pin, see the g pio alternate functions section on page 37. do not enable alternate functi on for gpio port pins which do not have an associated al- ternate function. failure to follow this guideline may result in unpredictable operation. table 17. port a ? h alternate function subregisters bit 7 6 5 4 3 2 1 0 field af7 af6 af5 af4 af3 af2 af1 af0 reset 0 r/w r/w address see note. note: if a 02h exists in the port a?h address register, it is accessible through the port a?h control register. bit description [7:0] ? afx port alternate function enabled 0 = the port pin is in normal mode and the dd x bit in the port a?h da ta direction subregis- ter determines the direction of the pin. 1 = the alternate function is selected. port pin operation is controlled by the alternate function. note: x indicates register bits in the range [7:0]. caution:
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 43 port a?h output c ontrol subregisters the port a?h output control subregister, show n in table 18, is accessed through the port a?h control register by writing 03h to the port a?h address register. setting the bits in the port a?h output control subr egisters to 1 configures the specified port pins for open- drain operation. these subregisters affect the pi ns directly and, as a result, alternate func- tions are also affected. table 18. port a?h out put control subregisters bit 7 6 5 4 3 2 1 0 field poc7 poc6 poc5 poc4 poc3 poc2 poc1 poc0 reset 0 r/w r/w address see note. note: if a 03h exists in the port a?h address register, it is accessible through the port a?h control register. bit description [7:0] ? pocx port output control these bits function independently of the alternate function bit and disables the drains if set to 1. 0 = the drains are enabled for any output mode. 1 = the drain of the associated pin is disabled (open-drain mode). note: x indicates register bits in the range [7:0].
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 44 port a?h high drive enable subregisters the port a?h high drive enable subregister, shown in table 19, is accessed through the port a?h control register by writing 04h to the port a?h address register. setting the bits in the port a?h high driv e enable subregisters to 1 conf igures the specified port pins for high-current output drive operation. the port a?h high drive enable subregister affects the pins directly and, as a resu lt, alternate functions are also affected. table 19. port a ? h high drive enable subregisters bit 7 6 5 4 3 2 1 0 field phde7 phde6 phde5 phde4 phde3 phde2 phde1 phde0 reset 0 r/w r/w address see note. note: if a 04h exists in the port a?h address register, it is accessible through the port a?h control register. bit description [7:0] ? phdex port high drive enabled 0 = the port pin is configured for standard output current drive. 1 = the port pin is configured for high output current drive. note: x indicates register bits in the range [7:0].
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 45 port a?h stop mode recovery source enable subregisters the port a?h stop mode recovery source en able subregister, shown in table 20, is accessed through the port a?h control register by writing 05h to the port a?h address register. setting the bits in the port a?h stop mode recovery source enable subregisters to 1 configures the specified port pins as a stop mode recovery source. during stop mode, any logic transition on a port pin enab led as a stop mode recovery source initiates stop mode recovery. table 20. port a ? h stop mode recovery source enable subregisters bit 7 6 5 4 3 2 1 0 field psmre7 psmre6 psmre5 psmre4 psmre3 psmre2 psmre1 psmre0 reset 0 r/w r/w address see note. note: if a 05h exists in the port a?h address register, it is accessible through the port a?h control register. bit description [7:0] ? psmre port stop mode recovery source enabled 0 = the port pin is not configured as a stop mode recovery source. transitions on this pin dur- ing stop mode do not initiate stop mode recovery. 1 = the port pin is configured as a stop mode recovery source. any logic transition on this pin during stop mode initiates stop mode recovery. note: x indicates register bits in the range [7:0].
ps019924-0113 p r e l i m i n a r y gpio control register definitions z8 encore! xp ? f64xx series product specification 46 port a?h input data registers reading from the port a?h input data register s, shown in table 21, returns the sampled values from the corresponding po rt pins. the port a?h input data registers are read-only. port a?h output data register the port a?h output data register, shown in table 22, writes output data to the pins. table 21. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh bit description [7:0] ? pxin port input data sampled data from the corresponding port pin input. 0 = input data is logical 0 (low). 1 = input data is logical 1 (high). note: x indicates register bits in the range [7:0]. table 22. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh bit description [7:0] ? pxout port output data these bits contain the data to be driven out from the port pins. the values are only driven if the corresponding pin is configured as an output and the pin is not configured for alternate function operation. 0 = drive a logical 0 (low). 1 = drive a logical 1 (high). high value is not driven if the drain has been disabled by setting the corresponding port output control register bit to 1. note: x indicates register bits in the range [7:0].
ps019924-0113 p r e l i m i n a r y interrupt controller z8 encore! xp ? f64xx series product specification 47 interrupt controller the interrupt controller on the z8 encore! xp f64xx series products prioritizes the inter- rupt requests from the on-chip peripherals and the gpio port pins. the features of the interrupt controller include: ? 24 unique interrupt vectors: ? 12 gpio port pin interrupt sources ? 12 on-chip peripheral interrupt sources ? ? flexible gpio interrupts ? eight selectable rising and falling edge gpio interrupts ? four dual-edge interrupts ? ? three levels of individually programmable interrupt priority ? watchdog timer can be configur ed to generate an interrupt ? interrupt requests (irqs) allow peripheral devi ces to suspend cpu oper ation in an orderly manner and force the cpu to start an interrupt service routine (isr). usually this interrupt service routine is involved with the exchange of data, status information, or control infor- mation between the cpu and the interrupting pe ripheral. when the service routine is com- pleted, the cpu returns to the operation from wh ich it was interrupted. the ez8 cpu supports both vectored and polled interrupt handling. for polled interrupts, the interrupt control has no effect on opera tion. for more informa tion about interrupt ser- vicing by the ez8 cpu, refer to the ez8 cpu core user manual (um0128) , which is available for download on www.zilog.com . interrupt vector listing table 23 lists all of the interrupts available in order of priority. the interrupt vector is stored with the most significant byte (msb) at the even program memory address and the least significant byte (lsb) at the following odd program memory address.
ps019924-0113 p r e l i m i n a r y interrupt vector listing z8 encore! xp ? f64xx series product specification 48 table 23. interrupt vectors in order of priority priority program memory ? vector address interrupt source highest 0002h reset (not an interrupt) 0004h watchdog timer (see the watchdog timer chapter on page 80) 0006h illegal instruction trap (not an interrupt) 0008h timer 2 000ah timer 1 000ch timer 0 000eh uart 0 receiver 0010h uart 0 transmitter 0012h i 2 c 0014h spi 0016h adc 0018h port a7 or port d7, rising or falling input edge 001ah port a6 or port d6, rising or falling input edge 001ch port a5 or port d5, rising or falling input edge 001eh port a4 or port d4, rising or falling input edge 0020h port a3 or port d3, rising or falling input edge 0022h port a2 or port d2, rising or falling input edge 0024h port a1 or port d1, rising or falling input edge 0026h port a0 or port d0, rising or falling input edge 0028h timer 3 (not available in the 44-pin package) 002ah uart 1 receiver 002ch uart 1 transmitter 002eh dma 0030h port c3, bo th input edges 0032h port c2, bo th input edges 0034h port c1, bo th input edges lowest 0036h port c0, both input edges
ps019924-0113 p r e l i m i n a r y architecture z8 encore! xp ? f64xx series product specification 49 architecture figure 11 displays a block diagram of the interrupt controller. operation this section describes th e operational aspects of the following functions. m aster interrupt enable : see page 49 interrupt vectors and priority : see page 50 interrupt assertion : see page 50 s oftware interrupt assertion : see page 51 master interrupt enable the master interrupt enable bit (irqe) in the interrupt control register globally enables and disables interrupts. interrupts are globally enabled by any of the following actions: ? executing an enable in terrupt (ei) instruction ? executing an return from in terrupt (iret) instruction figure 11. interrupt controller block diagram vector irq request high priority medium priority low priority priority mux interrupt request latches and control port interrupts internal interrupts
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 50 ? writing a 1 to the irqe bit in the interrupt control register ? interrupts are globally disabled by any of the following operations: ? execution of a disable interrupt (di) instruction ? ez8 cpu acknowledgement of an interrupt service request from the interrupt controller ? writing a 0 to the irqe bit in the interrupt control register ? reset ? executing a trap instruction ? illegal instruction trap interrupt vectors and priority the interrupt controller supports three levels of interrupt pr iority. level 3 is the highest priority, level 2 is the second highest priority , and level 1 is the lowest priority. if all of the interrupts were enabled with identical interrupt priority (all as level 2 interrupts, for example), then the interrupt priority would be assigned from highest to lowest, as speci- fied in table 23. level 3 interrupts always have higher priority than level 2 interrupts which, in turn, always have hi gher priority than level 1 inte rrupts. within each interrupt priority level (level 1, level 2, or level 3) , priority is assigned as specified in table 23. resets, watchdog timer interrupt s (if enabled), and illegal instruction traps always have highest priority. interrupt assertion interrupt sources assert their interrupt requests for only a single system clock period (sin- gle pulse). when the interrupt request is ac knowledged by the ez8 cpu, the correspond- ing bit in the interrupt reques t register is cleared until the next interrupt occurs. writing a 0 to the corresponding bit in the interrupt requ est register likewise clears the interrupt request. zilog recommends not using a coding style that clears bits in the interrupt request reg- isters. all incoming interrupt s received between execution of the first ldx command and the final ldx comm and are lost. see example 1, which follows. example 1. a poor coding style that can re sult in lost interrupt requests: ldx r0, irq0 ? and r0, mask ? ldx irq0, r0 ? caution:
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 51 to avoid missing interrupts, use the coding styl e in example 2 to clear bits in the interrupt request 0 register: example 2. a good coding style that av oids lost interrupt requests: andx irq0, mask software interrupt assertion program code can generate interrupts directly . writing a 1 to the appropriate bit in the interrupt request register trigge rs an interrupt (assuming that interrupt is enabled). when the interrupt request is acknow ledged by the ez8 cpu, the bit in the interrupt request register is automatically cleared to 0. zilog recommends not using a coding style to generate software interrupts by setting bits in the interrupt request registers. all inco ming interrupts received between execution of the first ldx command and the final ldx co mmand are lost. see example 3, which fol- lows. example 3. a poor coding style that can re sult in lost interrupt requests: ldx r0, irq0 ? or r0, mask ? ldx irq0, r0 to avoid missing interrupts, use the coding styl e in example 4 to set bits in the interrupt request registers: example 4. a good coding style that av oids lost interrupt requests: orx irq0, mask interrupt control register definitions for all interrupts other than the watchdog ti mer interrupt, the interrupt control registers enable individual interrupts, set interrupt priorities, and indicate interrupt requests. interrupt requ est 0 register the interrupt request 0 (irq0) register, shown in table 24, stores th e interrupt requests for both vectored and polled interrupts. when a request is presented to the interrupt con- troller, the corresponding bit in the irq0 register becomes 1. if interrupts are globally enabled (vectored interrupts), the interrupt cont roller passes an interrupt request to the ez8 cpu. if interrupts are globally disabled (polled interrupts), the ez8 cpu can read the interrupt request 0 register to determine if any interrupt requests are pending. caution:
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 52 table 24. interrupt request 0 register (irq0) bit 7 6 5 4 3 2 1 0 field t2i t1i t0i u0rxi u0txi i2ci spii adci reset 0 r/w r/w address fc0h bit description [7] ? t2i timer 2 interrupt request 0 = no interrupt request is pending for timer 2. 1 = an interrupt request from timer 2 is awaiting service. [6] ? t1i timer 1 interrupt request 0 = no interrupt request is pending for timer 1. 1 = an interrupt request from timer 1 is awaiting service. [5] ? t0i timer 0 interrupt request 0 = no interrupt request is pending for timer 0. 1 = an interrupt request from timer 0 is awaiting service. [4] ? u0rxi uart 0 receiver interrupt request 0 = no interrupt request is pending for the uart 0 receiver. 1 = an interrupt request from the ua rt 0 receiver is awaiting service. [3] ? u0txi uart 0 transmitter interrupt request 0 = no interrupt request is pending for the uart 0 transmitter. 1 = an interrupt request from the uart 0 transmitter is awaiting service. [2] ? i2ci i 2 c interrupt request 0 = no interrupt request is pending for the i 2 c. 1 = an interrupt request from the i 2 c is awaiting service. [1] ? spii spi interrupt request 0 = no interrupt request is pending for the spi. 1 = an interrupt request from the spi is awaiting service. [0] ? adci adc interrupt request 0 = no interrupt request is pending for the analog-to-digital converter. 1 = an interrupt request from the analog-to-digital converter is awaiting service.
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 53 interrupt requ est 1 register the interrupt request 1 (irq1) register, shown in table 25, stores interrupt requests for both vectored and polled interrupts. when a requ est is presented to th e interrupt controller, the corresponding bit in the irq1 register becomes 1. if interrupts are globally enabled (vectored interrupts), the interrupt controller pa sses an interrupt request to the ez8 cpu. if interrupts are globally disabl ed (polled interrupts), the ez8 cpu can read the interrupt request 1 register to determine if any interrupt requests are pending. for each pin, only 1 of either port a or po rt d can be enabled for interrupts at any one time. port selection (a or d) is determined by the values in the interrupt port select regis- ter (irqps) : see page 60. table 25. interrupt request 1 register (irq1) bit 7 6 5 4 3 2 1 0 field pad7i pad6i pad5i pad4i pad3i pad2i pad1i pad0i reset 0 r/w r/w address fc3h bit description [7:0] ? padxi port a or port d pin x interrupt request 0 = no interrupt request is pending for gpio port a or port d pin x. 1 = an interrupt request from gpio port a or port d pin x is awaiting service. note: x indicates the specific gpio port a or d pin in the range [7:0].
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 54 interrupt requ est 2 register the interrupt request 2 (irq2) register, shown in table 26, stores interrupt requests for both vectored and polled interrupts. when a requ est is presented to th e interrupt controller, the corresponding bit in the irq2 register becomes 1. if interrupts are globally enabled (vectored interrupts), the interrupt controller pa sses an interrupt request to the ez8 cpu. if interrupts are globally disabl ed (polled interrupts), the ez8 cpu can read the interrupt request 1 register to determine if any interrupt requests are pending. table 26. interrupt request 2 register (irq2) bit 7 6 5 4 3 2 1 0 field t3i u1rxi u1txi dmai pc3i pc2i pc1i pc0i reset 0 r/w r/w address fc6h bit description [7] ? t3i timer 3 interrupt request 0 = no interrupt request is pending for timer 3. 1 = an interrupt request from timer 3 is awaiting service. [6] ? u1rxi uart 1 receive interrupt request 0 = no interrupt request is pending for the uart1 receiver. 1 = an interrupt request from uart1 receiver is awaiting service. [5] ? u1txi uart 1 transmit interrupt request 0 = no interrupt request is pending for the uart 1 transmitter. 1 = an interrupt request from the uart 1 transmitter is awaiting service. [4] ? dmai dma interrupt request 0 = no interrupt request is pending for the dma. 1 = an interrupt request from the dma is awaiting service. [3:0] ? pcxi port c pin x interrupt request 0 = no interrupt request is pending for gpio port c pin x . 1 = an interrupt request from gpio port c pin x is awaiting service. note: x indicates the specific gpio port c pin in the range [3:0].
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 55 irq0 enable high and low bit registers table 27 describes the priority control for irq0. the irq0 enable high and low bit reg- isters, shown in tables 28 and 29, form a pr iority-encoded enabling for interrupts in the interrupt request 0 register. priority is generated by setting bits in each register. table 27. irq0 enable and priority encoding irq0enh[ x ]irq0enl[ x ] priority description 0 0 disabled disabled 0 1 level 1 low 1 0 level 2 nominal 1 1 level 3 high note: x indicates register bi ts in the range [7:0]. table 28. irq0 enable hi gh bit register (irq0enh) bit 7 6 5 4 3 2 1 0 field t2enh t1enh t0enh u0renh u0tenh i2cenh spienh adcenh reset 0 r/w r/w address fc1h bit description [7] ? t2enh timer 2 interrupt reque st enable high bit [6] ? t1enh timer 1 interrupt reque st enable high bit [5] ? t0enh timer 0 interrupt reque st enable high bit [4] ? u0renh uart 0 receive interrupt request enable high bit [3] ? u0tenh uart 0 transmit interrupt request enable high bit [2] ? i2cenh i 2 c interrupt request enable high bit [1] ? spienh spi interrupt request enable high bit [0] ? adcenh adc interrupt request enable high bit
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 56 irq1 enable high and low bit registers table 30 describes the priority control for irq1. the irq1 enable high and low bit reg- isters, shown in tables 31 and 32, form a pr iority-encoded enabling for interrupts in the interrupt request 1 register. priority is generated by setting bits in each register. table 29. irq0 enable low bit register (irq0enl) bit 7 6 5 4 3 2 1 0 field t2enl t1enl t0enl u0renl u0tenl i2cenl spienl adcenl reset 0 r/w r/w address fc2h bit description [7] ? t2enl timer 2 interrupt request enable low bit [6] ? t1enl timer 1 interrupt request enable low bit [5] ? t0enl timer 0 interrupt request enable low bit [4] ? u0renl uart 0 receive interrupt request enable low bit [3] ? u0tenl uart 0 transmit interrupt request enable low bit [2] ? i2cenl i 2 c interrupt request enable low bit [1] ? spienl spi interrupt request enable low bit [0] ? adcenl adc interrupt request enable low bit table 30. irq1 enable and priority encoding irq1enh[ x ]irq1enl[ x ] priority description 0 0 disabled disabled 0 1 level 1 low 1 0 level 2 nominal 1 1 level 3 high note: x indicates register bi ts in the range [7:0].
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 57 table 31. irq1 enable hi gh bit register (irq1enh) bit 7 6 5 4 3 2 1 0 field pad7enh pad6enh pad5enh pad4enh pad3enh pad2enh pad1enh pad0enh reset 00000000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address fc4h bit description [7:0] ? padxenh port a or port d bit[ x ] interrupt request enable high bit to select either port a or port d as the interrupt source, see the i nterrupt port select regis- ter on page 60. note: x indicates register bi ts in the range [7:0]. table 32. irq1 enable low bit register (irq1enl) bit 7 6 5 4 3 2 1 0 field pad7enl pad6enl pad5enl pad4enl pad3enl pad2enl pad1enl pad0enl reset 00000000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address fc5h bit description [7:0] ? padxenl port a or port d bit[ x ] interrupt request enable low bit to select either port a or port d as the interrupt source, see the i nterrupt port select regis- ter on page 60. note: x indicates register bi ts in the range [7:0].
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 58 irq2 enable high and low bit registers table 33 describes the priority control for irq2. the irq2 enable high and low bit reg- isters, shown in tables 34 and 35, form a pr iority-encoded enabling for interrupts in the interrupt request 2 register. priority is generated by setting bits in each register. table 33. irq2 enable and priority encoding irq2enh[ x ]irq2enl[ x ] priority description 0 0 disabled disabled 0 1 level 1 low 1 0 level 2 nominal 1 1 level 3 high note: x indicates register bi ts in the range [7:0]. table 34. irq2 enable hi gh bit register (irq2enh) bit 7 6 5 4 3 2 1 0 field t3enh u1renh u1tenh dmaenh c3enh c2enh c1enh c0enh reset 0 r/w r/w address fc7h bit description [7] ? t3enh timer 3 interrupt reque st enable high bit [6] ? u1renh uart 1 receive interrupt request enable high bit [5] ? u1tenh uart 1 transmit interrupt request enable high bit [4] ? dmaenh dma interrupt request enable high bit [3] ? c3enh port c3 interrupt requ est enable high bit [2] ? c2enh port c2 interrupt requ est enable high bit [1] ? c1enh port c1 interrupt requ est enable high bit [0] ? c0enh port c0 interrupt requ est enable high bit
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 59 table 35. irq2 enable low bit register (irq2enl) bit 7 6 5 4 3 2 1 0 field t3enl u1renl u1tenl dmaenl c3enl c2enl c1enl c0enl reset 0 r/w r/w address fc8h bit description [7] ? t3enl timer 3 interrupt request enable low bit [6] ? u1renl uart 1 receive interrupt request enable low bit [5] ? u1tenl uart 1 transmit interrupt request enable low bit [4] ? dmaenl dma interrupt request enable low bit [3] ? c3enl port c3 interrupt request enable low bit [2] ? c2enl port c2 interrupt request enable low bit [1] ? c1enl port c1 interrupt request enable low bit [0] ? c0enl port c0 interrupt request enable low bit
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 60 interrupt edge select register the interrupt edge select (ir qes) register, shown in table 36, determines whether an interrupt is generated for the rising edge or falling edge on the sel ected gpio port input pin. the interrupt port select register selec ts between port a and port d for the individ- ual interrupts. interrupt port select register the port select (irqps) register, shown in table 37, determines the port pin that gener- ates the pax/pdx interrupts. this register allows either port a or port d pins to be used as interrupts. the interrupt edge select regi ster controls the active interrupt edge. table 36. interrupt edge select register (irqes) bit 7 6 5 4 3 2 1 0 field ies7 ies6 ies5 ies4 ies3 ies2 ies1 ies0 reset 0 r/w r/w address fcdh bit description [7:0] ? iesx interrupt edge select x the minimum pulse width should be greater than 1 system clock to guarantee capture of the edge triggered interrupt. shorter pulses may be captured but not guaranteed. 0 = an interrupt request is generated on the falling edge of the pa x/pd x input. 1 = an interrupt request is generated on the rising edge of the pa x /pdx input. note: x indicates specific gpio port pins in the range [7:0]. table 37. interrupt port select register (irqps) bit 7 6 5 4 3 2 1 0 field pad7s pad6s pad5s pad4s pad3s pad2s pad1s pad0s reset 0 r/w r/w address fceh bit description [7:0] ? padxs pa x /pd x selection 0 = pa x is used for the interrupt for pa x/pd x interrupt request. 1 = pd x is used for the interrupt for pa x /pdx interrupt request. note: x indicates specific gpio port pins in the range [7:0].
ps019924-0113 p r e l i m i n a r y interrupt control register definitions z8 encore! xp ? f64xx series product specification 61 interrupt control register the interrupt control (irqctl) register, shown in table 38, contains the master enable bit for all interrupts. table 38. interrupt control register (irqctl) bit 7 6 5 4 3 2 1 0 field irqe reserved reset 0 r/w r/w r address fcfh bit description [7] ? irqe interrupt request enable this bit is set to 1 by execution of an ei or iret instruction, or by a dire ct register write of a 1 to this bit. it is reset to 0 by executing a di instruction, ez8 cpu ack nowledgement of an inter- rupt request, or a reset. 0 = interrupts are disabled. 1 = interrupts are enabled. [6:0] reserved these pins are reserved and must be programmed to 000000.
ps019924-0113 p r e l i m i n a r y timers z8 encore! xp ? f64xx series product specification 62 timers the z8 encore! xp f64x x series products contain up to four 16-bit reloadable timers that can be used for timing, event counting or generation of pulse-width modulated signals. the timers? features include: ? 16-bit reload counter ? programmable prescaler with prescale values from 1 to 128 ? pwm output generation ? capture and compare capability ? external input pin for timer input, clock ga ting, or capture signal. external input pin signal frequency is limited to a maximum of one-fourth the system clock frequency. ? timer output pin ? timer interrupt ? in addition to the timers described in this chapter, the baud ra te generators for any unused uart, spi or i 2 c peripherals can also be used to provide basic timing functionality. for information about using the baud rate genera tors as timers, see the respective serial com- munication peripheral. timer 3 is unav ailable in the 44-pin package devices. architecture figure 12 displays the architecture of the timers.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 63 operation the timers are 16-bit up-counters. minimum tim e-out delay is set by loading the value 0001h into the timer reload high and low by te registers and setting the prescale value to 1. maximum time-out delay is set by loading the value 0000h into the timer reload high and low byte registers and setting the prescale value to 128. if the timer reaches ffffh , the timer rolls over to 0000h and continues counting. timer operating modes the timers can be configured to operate in the following modes: one-shot mode in one-shot mode, the timer co unts up to the 16-bit reload value stored in the timer reload high and low byte registers. the timer input is the system clock. upon reaching the reload value, the timer ge nerates an interrupt and the co unt value in the timer high and low byte registers is reset to 0001h . then, the timer is automatically disabled and stops counting. also, if the timer output alternate function is enabled, the timer output pin changes state for one system clock cycle (fro m low to high or from high to low) upon timer reload. if figure 12. timer block diagram 16-bit pwm/compare 16-bit counter with prescaler 16-bit reload register timer control compare compare interrupt, pwm, and timer output control timer timer timer block system timer data block interrupt output control bus clock input gate input capture input
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 64 it is appropriate to have the timer output ma ke a permanent state change upon a one-shot time-out, first set the tpol bit in the timer co ntrol 1 register to the start value before beginning one-shot mode. then, after starting the timer, set tpol to the opposite bit value. observe the following procedure for config uring a timer for one-shot mode and initi- ating the count: 1. write to the timer control 1 register to: ? disable the timer ? configure the timer for one-shot mode ? set the prescale value ? if using the timer output alternate functio n, set the initial output level (high or low) ? 2. write to the timer high and low byte registers to set the starting count value. 3. write to the timer reload high and low byte registers to set the reload value. 4. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 5. if using the timer output function, configur e the associated gpio port pin for the timer output alternate function. 6. write to the timer control 1 register to enable the timer and initiate counting. ? in one-shot mode, the system clock always pr ovides the timer inpu t. the timer period is calculated using the following equation: continuous mode in continuous mode, the timer counts up to the 16-bit reload value stored in the timer reload high and low byte registers. the timer input is th e system clock. upon reaching the reload value, th e timer generates an interrupt, the count value in the timer high and low byte registers is reset to 0001h and counting resumes. also, if the timer output alternate function is en abled, the timer output pin ch anges state (from low to high or from high to low) upon timer reload. observe the following procedure for conf iguring a timer for continuous mode and initiating the count: 1. write to the timer control 1 register to: one-shot mode time-out period (s) reload value start value ? ?? prescale ? system clock frequency (hz) ------------------------------------------------------------------------------------------------ - =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 65 ? disable the timer ? configure the timer for continuous mode ? set the prescale value ? if using the timer output alternate functio n, set the initial output level (high or low) ? 2. write to the timer high and low byte regist ers to set the starting count value (usually 0001h ), affecting only the first pass in c ontinuous mode. after the first timer reload in continuous mode, counting al ways begins at the reset value of 0001h . 3. write to the timer reload high and low byte registers to set the reload value. 4. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 5. if using the timer output function, configur e the associated gpio port pin for the timer output alternate function. 6. write to the timer control 1 register to enable the timer and initiate counting. in continuous mode, the system clock alwa ys provides the timer input. the timer period is calculated us ing the following equation: if an initial starting value other than 0001h is loaded into the timer high and low byte registers, the one-shot mode equation must be used to determine the first time-out period. counter mode in counter mode, the timer counts input tr ansitions from a gpio port pin. the timer input is taken from the gpio port pin timer input alternate function. the tpol bit in the timer control 1 register selects whether the co unt occurs on the rising edge or the falling edge of the timer input signal. in counter mode, the prescaler is disabled. the input frequency of the timer input sign al must not exceed one-fourth the system clock frequency. upon reaching the reload value stored in the timer reload high and low byte registers, the timer generates an interrupt, the count value in the ti mer high and low byte registers is reset to 0001h and counting resumes. also, if th e timer output alternate function is continuous mode ti me-out period (s) reload value prescale ? system clock frequency (hz) ------------------------------------------------------------------------ = caution:
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 66 enabled, the timer output pin changes state (from low to high or from high to low) at timer reload. observe the following procedure for configuring a timer for coun ter mode and initiat- ing the count: 1. write to the timer control 1 register to: ? disable the timer. ? configure the timer for counter mode. ? select either the rising edge or falling edge of the timer input signal for the count. this also sets the initial logic level (h igh or low) for the timer output alternate function. however, the timer output fu nction does not have to be enabled. ? 2. write to the timer high and low byte regi sters to set the startin g count value. this only affects the first pass in counter mode. after the first timer reload in coun- ter mode, counting always begins at the reset value of 0001h . generally, in coun- ter mode the timer high and low byte re gisters must be written with the value 0001h . 3. write to the timer reload high and low byte registers to set the reload value. 4. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 5. configure the associated gpio port pi n for the timer input alternate function. 6. if using the timer output function, configur e the associated gpio port pin for the timer output alternate function. 7. write to the timer control 1 register to enable the timer. ? in counter mode, the number of timer input transitions si nce the timer start is calcu- lated using the following equation: pwm mode in pwm mode, the timer outputs a pulse-widt h modulator (pwm) output signal through a gpio port pin. the timer input is the system clock. the timer first counts up to the 16- bit pwm match value stored in the timer pw m high and low byte registers. when the timer count value matches the pwm value, the timer output toggles. the timer continues counting until it reaches the reload value stor ed in the timer reload high and low byte registers. upon reaching the reload value, th e timer generates an interrupt, the count value in the timer high and low byte registers is reset to 0001h and counting resumes. counter mode timer input transitions current count value start value ? =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 67 if the tpol bit in the timer control 1 register is set to 1, the timer output signal begins as a high (1) and then transitions to a lo w (0) when the timer value matches the pwm value. the timer output signal returns to a hi gh (1) after the timer reaches the reload value and is reset to 0001h . if the tpol bit in the timer control 1 register is set to 0, the timer output signal begins as a low (0) and then transitions to a high (1) when the timer value matches the pwm value. the timer output signal returns to a lo w (0) after the timer reaches the reload value and is reset to 0001h . observe the following procedure for configur ing a timer for pwm mode and initiating the pwm operation: 1. write to the timer control 1 register to: ? disable the timer ? configure the timer for pwm mode ? set the prescale value ? set the initial logic level (high or low) and pwm high/low transition for the timer output alternate function ? 2. write to the timer high and low byte regi sters to set the starting count value (typi- cally 0001h ). this only affects the first pass in pwm mode. after the first timer reset in pwm mode, counting always begins at the reset value of 0001h . 3. write to the pwm high and low byte registers to set the pwm value. 4. write to the timer reload high and low byte registers to set the reload value (pwm period). the reload value must be greater than the pwm value. 5. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 6. configure the associated gpio port pin for the timer output alternate function. 7. write to the timer control 1 register to enable the timer and initiate counting. ? the pwm period is calculated using the following equation: if an initial starting value other than 0001h is loaded into the timer high and low byte registers, the one-shot mode equation must be used to determine the first pwm time- out period. pwm period (s) reload value prescale ? system clock frequency (hz) ------------------------------------------------------------------------ =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 68 if tpol is set to 0, the ratio of the pwm output high time to the total period is calculated using the following equation: if tpol is set to 1, the ratio of the pwm output high time to the total period is calculated using the following equation: capture mode in capture mode, the current timer count valu e is recorded when the appropriate exter- nal timer input transition occu rs. the capture count value is written to the timer pwm high and low byte registers. the timer inpu t is the system clock. the tpol bit in the timer control 1 register determines if the ca pture occurs on a rising edge or a falling edge of the timer input signal . when the capture event occurs , an interrupt is generated and the timer continues counting. the timer continues coun ting up to the 16-bit reload valu e stored in the timer reload high and low byte registers. upon reaching th e reload value, the timer generates an inter- rupt and continues counting. observe the following procedure for config uring a timer for capture mode and initiat- ing the count: 1. write to the timer control 1 register to: ? disable the timer ? configure the timer for capture mode ? set the prescale value ? set the capture edge (rising or falling) for the timer input ? 2. write to the timer high and low byte regi sters to set the starting count value (typi- cally 0001h ). 3. write to the timer reload high and low byte registers to set the reload value. 4. clear the timer pwm high and low byte registers to 0000h . this allows the soft- ware to determine if interrupt s were generated by either a capture event or a reload. if the pwm high and low byte registers still contain 0000h after the interrupt, then the interrupt was generated by a reload. 5. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. pwm output high time ratio (%) reload value pwm value ? reload value -------------------------------------------------------------------- - 100 ? = pwm output high time ratio (%) pwm value reload value -------------------------------- 100 ? =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 69 6. configure the associated gpio port pi n for the timer input alternate function. 7. write to the timer control 1 register to enable the timer and initiate counting. ? in capture mode, the elapsed time from timer start to capture event can be calculated using the following equation: compare mode in compare mode, the timer counts up to the 16-bit maximum compare value stored in the timer reload high and low byte registers. the timer input is th e system clock. upon reaching the compare value, the timer genera tes an interrupt and counting continues (the timer value is not reset to 0001h ). also, if the timer output alternate function is enabled, the timer output pin changes state (from low to high or from high to low) upon com- pare. if the timer reaches ffffh , the timer rolls over to 0000h and continue counting. observe the following procedure for config uring a timer for compare mode and initiat- ing the count: 1. write to the timer control 1 register to: ? disable the timer ? configure the timer for compare mode ? set the prescale value ? set the initial logic level (high or low) fo r the timer output alternate function, if appropriate ? 2. write to the timer high and low byte registers to set the starting count value. 3. write to the timer reload high and low byte registers to set the compare value. 4. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 5. if using the timer output function, configur e the associated gpio port pin for the timer output alternate function. 6. write to the timer control 1 register to enable the timer and initiate counting. ? in compare mode, the system clock always provides the timer inpu t. the compare time is calculated using the following equation: capture elapsed time (s) capture value start value ? ?? prescale ? system clock frequency (hz) -------------------------------------------------------------------------------------------------- - =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 70 gated mode in gated mode, the timer counts only when the timer input si gnal is in its active state (asserted), as determined by the tpol bit in the timer control 1 register. when the timer input signal is asserted, counting begins. a timer interrupt is generated when the timer input signal is deasserted or a timer reload occurs. to determine if a timer input signal deassertion generated the interrupt, read the as sociated gpio input value and compare to the value stored in the tpol bit. the timer counts up to the 16-bit reload value stored in th e timer reload high and low byte registers. the timer input is the system clock. when r eaching the reload value, the timer generates an interrupt, the count value in the timer high and low byte registers is reset to 0001h and counting resumes (assuming the tim er input signal is still asserted). also, if the timer output alternate function is enabled, the timer output pin changes state (from low to high or from hi gh to low) at timer reset. observe the following procedure for configur ing a timer for gated mode and initiating the count: 1. write to the timer control 1 register to: ? disable the timer ? configure the timer for gated mode ? set the prescale value ? 2. write to the timer high and low byte regi sters to set the startin g count value. this only affects the first pass in gated mode. after the first timer reset in gated mode, counting always begins at the reset value of 0001h . 3. write to the timer reload high and low byte registers to set the reload value. 4. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 5. configure the associated gpio port pi n for the timer input alternate function. 6. write to the timer control 1 register to enable the timer. 7. assert the timer input signal to initiate the counting. capture/compare mode in capture/compare mode, th e timer begins counting on the first external timer input transition. the appropriate transition (risi ng edge or falling edge) is set by the tpol bit in the timer control 1 register. th e timer input is the system clock. compare mode time (s) compare value start value ? ?? prescale ? system clock frequency (hz) ----------------------------------------------------------------------------------------------------- - =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 71 every subsequent appropriate transition (after the first) of the timer input signal captures the current count value. the capture valu e is written to the timer pwm high and low byte registers. when the capt ure event occurs, an interrupt is generated, the count value in the timer high and low byte registers is reset to 0001h , and counting resumes. if no capture event occurs, the timer counts up to the 16-bit compare value stored in the timer reload high and low byte registers. up on reaching the compare value, the timer generates an interrupt, the count value in the timer high and low byte registers is reset to 0001h and counting resumes. observe the following procedure for configuring a timer for capture/compare mode and initiating the count: 1. write to the timer control 1 register to: ? disable the timer ? configure the timer for capture/compare mode ? set the prescale value ? set the capture edge (rising or falling) for the timer input ? 2. write to the timer high and low byte regi sters to set the starting count value (typi- cally 0001h ). 3. write to the timer reload high and low byte registers to set the compare value. 4. if appropriate, enable the timer interrupt an d set the timer interrupt priority by writing to the relevant interrupt registers. 5. configure the associated gpio port pi n for the timer input alternate function. 6. write to the timer control 1 register to enable the timer. 7. counting begins on the first appropriate tr ansition of the timer in put signal. no inter- rupt is generated by this first edge. ? in compare mode, the elapsed time from timer start to capture event can be calculated using the following equation: reading the timer count values the current count va lue in the timers can be read while counting (enabled). this capability has no effect on timer operation. when the timer is enabled and the timer high byte reg- ister is read, the contents of the timer low by te register are placed in a holding register. a subsequent read from the timer low byte re gister returns the valu e in the holding reg- capture elapsed time (s) capture value start value ? ?? prescale ? system clock frequency (hz) -------------------------------------------------------------------------------------------------- - =
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 72 ister. this operation allows accurate reads of the full 16-bit timer count value while enabled. when the timers are not enabled, a read from the timer low byte register returns the actual va lue in the counter. timer output signal operation a timer output is a gpio port pin alternate fu nction. generally, the timer output is toggled every time the counter is reloaded. timer control register definitions this section defines the features of the following timer control registers. timer 0?3 h igh and low byte registers : see page 72 t imer reload high and low byte registers : see page 74 timer 0?3 p wm high and low byte registers : see page 75 timer 0?3 c ontrol 0 registers : see page 76 timer 0?3 c ontrol 1 registers : see page 77 ? timers 0?2 are available in all packages. timer 3 is only available in 64-, 68- and 80-pin packages. timer 0?3 high and low byte registers the timer 0?3 high and low byte (txh and txl) registers, shown in tables 39 and 40, contain the current 16-bit timer count value. when the timer is enabled, a read from txh causes the value in txl to be stored in a temporary holding register. a read from tmrl always returns this temporary register when the timers are enabled. when the timer is dis- abled, reads from the tmrl read the register directly. writing to the timer high and low byte regist ers while the timer is enabled is not recom- mended. there are no temporary holding regist ers available for write operations, so simul- taneous 16-bit writes are not possible. if eith er the timer high or low byte registers are written during counting, the 8- bit written value is placed in the counter (high or low byte) at the next clock edge. the counte r continues counting from the new value. timer 3 is unavailable in 44-pin packages.
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 73 table 39. timer 0?3 high byte register (txh) bit 7 6 5 4 3 2 1 0 field th reset 0 r/w r/w address f00h, f08h, f10h, f18h table 40. timer 0?3 low byte register (txl) bit 7 6 5 4 3 2 1 0 field tl reset 01 r/w r/w address f01h, f09h, f11h, f19h bit description [7:0] ? th, tl timer high and low bytes these 2 bytes, {tmrh[7:0], tmrl[7:0]}, contain the current 16-bit timer count value.
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 74 timer reload high and low byte registers the timer 0?3 reload high and low byte (txrh and txrl) registers, shown in tables 41 and 42, store a 16-bit reload value, {trh[7:0], trl[7:0]}. values written to the timer reload high byte register are stored in a temporary holding register. when a write to the timer reload low byte register occu rs, the temporary holding register value is written to the timer high byte register. this operation allows si multaneous updates of the 16-bit timer reload value. in compare mode, the timer reload high an d low byte registers store the 16-bit com- pare value. table 41. timer 0?3 reload high byte register (txrh) bit 7 6 5 4 3 2 1 0 field trh reset 1 r/w r/w address f02h, f0ah, f12h, f1ah table 42. timer 0?3 reload low byte register (txrl) bit 7 6 5 4 3 2 1 0 field trl reset 1 r/w r/w address f03h, f0bh, f13h, f1bh bit description [7:0] ? trh, trl timer reload register high and low these two bytes form the 16-bit reload value, {trh [7:0], trl[7:0]}. this value sets the maxi- mum count value which init iates a timer reload to 0001h . in compare mode, these two bytes form the 16-bit compare value.
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 75 timer 0?3 pwm high and low byte registers the timer 0?3 pwm high and low byte (txpwmh and txpwml) registers, shown in tables 43 and 44, are used for pulse-width modulator (pwm) operations. these registers also store the capture values for th e capture and capture/compare modes. table 43. timer 0?3 pwm high byte register (txpwmh) bit 7 6 5 4 3 2 1 0 field pwmh reset 0 r/w r/w address f04h, f0ch, f14h, f1ch table 44. timer 0?3 pwm low byte register (txpwml) bit 7 6 5 4 3 2 1 0 field pwml reset 0 r/w r/w address f05h, f0dh, f15h, f1dh bit description [7:0] ? pwmh, pwml pulse-width modulator high and low bytes these two bytes, {pwmh[7:0], pwml[7:0]}, form a 16 -bit value that is compared to the current 16-bit timer count. when a match occurs, t he pwm output changes state. the pwm output value is set by the tpol bit in the timer cont rol 1 register (txctl1) register. the txpwmh and txpwml registers also store the 16-bit ca ptured timer value when operating in capture or capture/compare modes.
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 76 timer 0?3 control 0 registers the timer 0?3 control 0 (txctl0) registers, shown in tables 45 and 46, allow cascading of the timers. table 45. timer 0?3 control 0 register (txctl0) bit 7 6 5 4 3 2 1 0 field reserved csc reserved reset 0 r/w r/w address f06h, f0eh, f16h, f1eh bit description [7:5] reserved these bits are reserved and must be programmed to 000. [4] ? csc cascade timers 0 = timer input signal comes from the pin. 1 = for timer 0, the input signal is connected to timer 3 output. ? for timer 1, the input signal is connected to the timer 0 output. ? for timer 2, the input signal is connected to the timer 1 output. ? for timer 3, the input signal is connected to the timer 2 output. [3:0] reserved these bits are reserved and must be programmed to 0000.
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 77 timer 0?3 control 1 registers the timer 0?3 control 1 (txctl1) registers en able/disable the timers, set the prescaler value, and determine the timer operating mode. table 46. timer 0?3 control 1 register (txctl1) bit 7 6 5 4 3 2 1 0 field ten tpol pres tmode reset 0 r/w r/w address f07h, f0fh, f17h, f1fh
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 78 bit description [7] ? ten timer enable 0 = timer is disabled. 1 = timer enabled to count. [6] ? tpol timer input/output polarity operation of this bit is a function of the current operating mode of the timer. one-shot mode when the timer is disabled, the timer output signal is set to the value of this bit. when the timer is enabled, the timer output signal is complemented upon timer reload. continuous mode when the timer is disabled, the timer output signal is set to the value of this bit. when the timer is enabled, the timer output signal is complemented upon timer reload. counter mode when the timer is disabled, the timer output signal is set to the value of this bit. when the timer is enabled, the timer output signal is complemented upon timer reload. 0 = count occurs on the rising edge of the timer input signal. 1 = count occurs on the falling ed ge of the timer input signal. pwm mode 0 = timer output is forced low (0) when the timer is disabled. when enabled, the timer output is forced high (1) upon pwm count match and forced low (0) upon reload. 1 = timer output is forced high (1) when the ti mer is disabled. when enabled, the timer output is forced low (0) upon pwm count match and forced high (1) upon reload. capture mode 0 = count is captured on the risi ng edge of the timer input signal. 1 = count is captured on the fa lling edge of the ti mer input signal. compare mode when the timer is disabled, the timer output signal is set to the value of this bit. when the timer is enabled, the timer output signal is complemented upon timer reload. gated mode 0 = timer counts when the timer input signal is high (1) and interrupts are generated on the falling edge of the timer input. 1 = timer counts when the timer input signal is low (0) and interrupts are generated on the ris- ing edge of the timer input. capture/compare mode 0 = counting is started on the first rising edge of the timer input signal. the current count is captured on subsequent rising ed ges of the timer input signal. 1 = counting is started on the first falling edge of the timer input signal. the current count is captured on s ubsequent falling edges of the timer input signal. caution: when the timer output alternate function txout on a gpio port pin is enabled, txout will change to whatever stat e the tpol bit is in. the time r does not need to be enabled for that to happen. also, the port data direction subregister is not needed to be set to output on txout. changing the tpol bit with the timer enabled and running does not immediately change the txout.
ps019924-0113 p r e l i m i n a r y timer control register definitions z8 encore! xp ? f64xx series product specification 79 [5:3] ? pres prescale value the timer input clock is divided by 2 pres , where pres can be set from 0 to 7. the prescaler is reset each time the timer is disabled to ensure proper clock division each time the timer is restarted. 000 = divide by 1. 001 = divide by 2. 010 = divide by 4. 011 = divide by 8. 100 = divide by 16. 101 = divide by 32. 110 = divide by 64. 111 = divide by 128. [2:0] ? tmode timer mode 000 = one-shot mode. 001 = continuous mode. 010 = counter mode. 011 = pwm mode. 100 = capture mode. 101 = compare mode. 110 = gated mode. 111 = capture/compare mode. bit description (continued)
ps019924-0113 p r e l i m i n a r y watchdog timer z8 encore! xp ? f64xx series product specification 80 watchdog timer the watchdog timer (wdt) helps protect agai nst corrupt or unreliable software, power faults and other system-level problems whic h can place the z8 encore! xp f64xx series mcu into unsuitable operatin g states. the features of the watchdog timer include: ? on-chip rc oscillator ? a selectable time-out response ? wdt time-out response: reset or interrupt ? 24-bit programmable time-out value operation the watchdog timer is a retr iggerable one-shot timer that resets or interrupts the z8 encore! xp f64xx series devices when the wd t reaches its terminal count. the watch- dog timer uses its own dedicate d on-chip rc oscillator as its clock source. the watchdog timer has only two modes of operation: on and off. after it is enabled, it always counts and must be refreshed to prevent a time-out. an enable can be performed by executing the wdt instruction or by setting the wdt_ao option bit. this wdt_ao bit enables the watchdog timer to operate continuously, ev en if a wdt instruction has not been exe- cuted. the watchdog timer is a 24-bit reloadable downcounter that uses three 8-bit registers in the ez8 cpu register space to set the reload value. the nominal wdt time-out period is calculated using the following equation: in the above equation, the wdt reload value is the decimal value of the 24-bit value pro- vided by {wdtu[7:0], wdth[7:0], wdtl[7:0]}; the typical watchdog timer rc oscil- lator frequency is 10 khz. the watchdog timer cannot be refreshed after it reaches 000002h . the wdt reload value must not be set to values below 000004h . table 47 lists approximate time-out delays for the minimum and maximum wdt reload values. wdt time-out period (ms) wdt reload value 10 ----------------------------------------------- - =
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 81 watchdog timer refresh when first enabled, the watchdog timer is loaded with the value in the watchdog timer reload registers. the watchd og timer then counts down to 000000h unless a wdt instruction is executed by the ez8 cpu. ex ecution of the wdt instruction causes the downcounter to be reloaded with the wdt re load value stored in the watchdog timer reload registers. counting resume s following the reload operation. when the z8 encore! xp f64x x series devices are operating in debug mode (through the on-chip debugger), the watchdog timer is continuously refreshed to prevent spuri- ous watchdog timer time-outs. watchdog timer time-out response the watchdog timer times ou t when the counter reaches 000000h . a time-out of the watchdog timer generates either an interrupt or a reset. the wdt_res option bit deter- mines the time-out response of the watchdog timer. for informat ion about programming of the wdt_res option bit, see the option bits chapter on page 180. wdt interrupt in normal operation if configured to generate an interrupt when a time-out occu rs, the watchdog timer issues an interrupt request to the in terrupt controller and sets the wd t status bit in the watchdog timer control register. if interrupts are enabled, the ez8 cpu responds to the interrupt request by fetching the watch dog timer interrupt vector an d executing code from the vec- tor address. after time-out and interrupt ge neration, the watchdog timer counter rolls over to its maximum value of fffffh and continues counting. the watchdog timer counter is not automatically re turned to its reload value. wdt interrupt in stop mode if configured to generate an interrupt when a time-out oc curs and the z8 encore! xp f64xx series devices are in stop mode, th e watchdog timer automatically initiates a stop mode recovery and generates an interrupt request. both the wdt status bit and the stop bit in the watchdog timer control register are set to 1 following wdt time-out in table 47. watchdog timer approximate time-out delays wdt reload value (hex) wdt reload value (decimal) approximate time-out delay (with 10 khz typical wdt oscillator frequency) typical description 000004 4 400 s minimum time-out delay ffffff 16,777,215 1677.5 s maximum time-out delay
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 82 stop mode. for more information ab out stop mode recovery, see the reset and stop mode recovery chapter on page 28. if interrupts are enabled, following completi on of the stop mode recovery the ez8 cpu responds to the interrupt request by fetching the watchdog timer interrupt vector and exe- cuting code from the vector address. wdt reset in normal operation if configured to generate a reset when a tim e-out occurs, the watchdog timer forces the device into the reset state. the wdt status b it in the watchdog timer control register is set to 1. for more inform ation about reset, see the reset and stop mode recovery chapter on page 28. wdt reset in stop mode if enabled in stop mode and configured to generate a reset when a time-out occurs and the device is in stop mode, the watchdog ti mer initiates a stop mo de recovery. both the wdt status bit and the stop bit in the wa tchdog timer control register are set to 1 following wdt time-out in stop mode. defa ult operation is for the wdt and its rc oscillator to be enabled during stop mode. wdt rc disable in stop mode to minimize power consumption in stop mode, the wdt and its rc oscillator can be disabled in stop mode. the following sequence configures the wdt to be disabled when the z8 encore! xp f64xx series devic es enter stop mode following execution of a stop instruction: 1. write 55h to the watchdog timer control register (wdtctl). 2. write aah to the watchdog timer control register (wdtctl). 3. write 81h to the watchdog timer control regi ster (wdtctl) to configure the wdt and its oscillator to be disabled duri ng stop mode. alternatively, write 00h to the watchdog timer control register (wdtctl) as the third step in this sequence to reconfigure the wdt and its oscillator to be enabled during stop mode. ? this sequence only affects wd t operation in stop mode. watchdog timer relo ad unlock sequence writing the unlock sequ ence to the watchdog timer (wdt ctl) control register address unlocks the three watc hdog timer reload byte registers (wdtu, wdth, and wdtl) to allow changes to the time-out period. these write operations to the wdtctl register address produce no effect on the bits in the wdtctl register. the locking mechanism prevents spurious writes to the reload registers. observe the following procedure to
ps019924-0113 p r e l i m i n a r y watchdog timer control register z8 encore! xp ? f64xx series product specification 83 unlock the watchdog timer reload byte re gisters (wdtu, wdth, and wdtl) for write access. 1. write 55h to the watchdog timer control register (wdtctl). 2. write aah to the watchdog timer control register (wdtctl). 3. write the watchdog timer reload upper byte register (wdtu). 4. write the watchdog timer reload high byte register (wdth). 5. write the watchdog timer relo ad low byte register (wdtl). ? all steps of the watchdog timer reload unlo ck sequence must be wr itten in the sequence described above; there must be no other re gister writes between each of these operations. if a register write occurs, the lock state m achine resets and no further writes can occur, unless the sequence is restarted. the value in the watchdog timer reload registers is loaded into the counter when the watchdog timer is first enabled and every time a wdt instruction is executed. watchdog timer control register definitions this section defines the features of the fo llowing watchdog timer control registers. w atchdog timer control register : see page 83 w atchdog timer reload upper, high and low byte registers : see page 85 watchdog timer control register the watchdog timer control (wdtctl) register, shown in table 48, is a read-only reg- ister that indicates the source of the most recent reset event, indicates a stop mode recovery event, and indicates a watchdog timer time-out. reading this register resets the upper four bits to 0. writing the 55h , aah unlock sequence to the watchdog timer control (wdtctl) regis- ter address unlocks the three watchdog time r reload byte registers (wdtu, wdth, and wdtl) to allow changes to the time-out period. these write operations to the wdtctl register address produce no effect on the bits in the wdtctl register. the locking mechanism prevents spurious writes to the reload registers.
ps019924-0113 p r e l i m i n a r y watchdog timer control register z8 encore! xp ? f64xx series product specification 84 table 48. watchdog timer control register (wdtctl) bit 7 6 5 4 3 2 1 0 field por stop wdt ext reserved sm reset see table 49. 0 r/w r address ff0h bit description [7] ? por power-on reset indicator if this bit is set to 1, a power- on reset event occurred. this bit is reset to 0 if a wdt time-out or stop mode recovery occurs. this bit is also reset to 0 when the register is read. [6] ? stop stop mode recovery indicator if this bit is set to 1, a stop mode recovery occurr ed. if the stop and wdt bits are both set to 1, the stop mode recovery occurred due to a wdt time-out. if the stop bit is 1 and the wdt bit is 0, the stop mode recovery was not caused by a wdt time-out. this bit is reset by a power-on reset or a wdt time-out that occurred while not in stop mode. reading this regis- ter also resets this bit. [5] ? wdt watchdog timer time-out indicator if this bit is set to 1, a wdt time-out occurred . a power-on reset resets this pin. a stop mode recovery from a change in an input pin also resets this bit. reading this register resets this bit. [4] ? ext external reset indicator if this bit is set to 1, a reset initiated by the external reset pin occurred. a power-on reset or a stop mode recovery from a change in an in put pin resets this bit. reading this register resets this bit. [3:1] reserved these bits are reserved and must be programmed to 000. [0] ? sm stop mode configuration indicator 0 = watchdog timer and its internal rc osc illator will continue to operate in stop mode. 1 = watchdog timer and its internal rc oscillator will be disabled in stop mode.
ps019924-0113 p r e l i m i n a r y watchdog timer control register z8 encore! xp ? f64xx series product specification 85 watchdog timer reload upper, high and low byte registers the watchdog timer reload upper, high and low byte (wdtu, wdth, wdtl) regis- ters, shown in tables 50 through 52, form the 24-bit reload value that is loaded into the watchdog timer when a wdt instruction executes. the 24-bit reload value is {wdtu[7:0], wdth[7:0], wdtl[7:0]}. writing to these registers sets the appropriate reload value. reading from these register s returns the current watchdog timer count value. the 24-bit wdt reload value must not be set to a value less than 000004h . table 49. watchdog timer events reset or stop mode recovery event por stop wdt ext power-on reset 1000 reset using reset pin assertion 0001 reset using watchdog timer time-out 0010 reset using the on-chip debugger (ocdctl[1] set to 1)1000 reset from stop mode using dbg pin driven low 1000 stop mode recovery using gpio pin transition 0100 stop mode recovery using watchdog timer time-out 0110 table 50. watchdog timer reload upper byte register (wdtu) bit 7 6 5 4 3 2 1 0 field wdtu reset 1 r/w r/w* address ff1h note: *r/w = read returns the current wdt count va lue; write sets the app ropriate reload value. bit description [7:0] ? wdtu wdt reload upper byte most significant byte, bits[23:16] of the 24-bit wdt reload value. caution:
ps019924-0113 p r e l i m i n a r y watchdog timer control register z8 encore! xp ? f64xx series product specification 86 table 51. watchdog timer reload high byte register (wdth) bit 7 6 5 4 3 2 1 0 field wdth reset 1 r/w r/w* address ff2h note: *r/w = read returns the current wdt count va lue; write sets the appropriate reload value. bit description [7:0] ? wdth wdt reload high byte middle byte, bits[15:8] of the 24-bit wdt reload value. table 52. watchdog timer reload low byte register (wdtl) bit 7 6 5 4 3 2 1 0 field wdtl reset 1 r/w r/w* address ff3h note: *r/w = read returns the current wdt count va lue; write sets the appropriate reload value. bit description [7:0] ? wdtl wdt reload low least significant byte, bits[7:0] of the 24-bit wdt reload value.
ps019924-0113 p r e l i m i n a r y universal asynchronous receiver/ z8 encore! xp ? f64xx series product specification 87 universal asynchronous receiver/ transmitter the universal asynchronous receiver/transmitter (uart) is a full-duplex communica- tion channel capable of handling asynchronous data transfers. the uart uses a single 8-bit data mode with selectable parity. features of the uart include: ? 8-bit asynchronous data transfer ? selectable even- and odd-parity generation and checking ? option of one or two stop bits ? separate transmit and receive interrupts ? framing, parity, overrun and break detection ? separate transmit and receive enables ? 16-bit baud rate generator (brg) ? selectable multiprocessor (9-bit) mode with three configurable interrupt schemes ? baud rate generator timer mode ? driver enable output for external bus transceivers architecture the uart consists of thre e primary functional blocks: transmitter, receiver and baud rate generator. the uart?s transmitter and receiver function independently, but employ the same baud rate and data format. fi gure 13 displays the uart architecture.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 88 operation the uart always transmits and receives data in an 8-bit data format, least significant bit first. an even or odd parity bit can be optio nally added to the data stream. each character begins with an active low start bit and ends with either 1 or 2 active high stop bits. figures 14 and 15 display the asynchronous data format employed by the uart without parity and with parity, respectively. figure 13. uart block diagram receive shifter receive data transmit data transmit shift txd rxd system bus parity checker parity generator receiver control control registers transmitter control cts status register register register register baud rate generator de with address compare
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 89 transmitting data us ing the polled method observe the following procedure to transmit data using the polled method of operation: 1. write to the uart baud rate high and low byte registers to set the appropriate baud rate. 2. enable the uart pin functions by config uring the associated gpio port pins for alternate function operation. 3. if multiprocessor mode is appropriate, write to the uart control 1 register to enable multiprocessor (9-bit) mode functions. ? set the multiprocessor mode select (mpen) to enable multiproces- sor mode 4. write to the uart control 0 register to: ? set the transmit enable bit (ten) to enable the uart for data transmission ? if parity is appropriate and multiproc essor mode is not enabled, set the par- ity enable bit (pen) and select e ither even or odd parity (psel) figure 14. uart asynchronous data format without parity figure 15. uart asynchronous data format with parity start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 data field lsb msb idle state of line stop bit(s) 1 2 1 0 start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity data field lsb msb idle state of line stop bit(s) 1 2 1 0
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 90 ? set or clear the ctse bit to enable or disable control from the remote receiver using the cts pin ? 5. check the tdre bit in the uart status 0 re gister to determine if the transmit data register is empty (indicated by a 1). if empty, continue to step 6 . if the transmit data register is full (indicated by a 0), continue to monitor the tdre bit until the transmit data register becomes ava ilable to receive new data. 6. write the uart control 1 register to select the outgoing address bit. 7. set the multiprocessor bit transmitter (mpbt) if sending an address byte; clear it if sending a data byte. 8. write the data byte to the uart transm it data register. the transmitter automati- cally transfers the data to the transmit shift register and transmits the data. 9. if appropriate and multiprocessor mode is enabled, make any changes to the multiprocessor bit transmitter (mpbt) value. 10. to transmit additional bytes, return to step 5 . transmitting data using the interrupt-driven method the uart transmitter interrupt indicates the avai lability of the transmit data register to accept new data for transmission. observe th e following procedure to configure the uart for interrupt-driven data transmission: 1. write to the uart baud rate high and low byte registers to set the appropriate baud rate. 2. enable the uart pin functions by config uring the associated gpio port pins for alternate function operation. 3. execute a di instruction to disable interrupts. 4. write to the interrupt control registers to enable the uart transmitter interrupt and set the appropriate priority. 5. if multiprocessor mode is appropriate, write to the uart control 1 register to enable multiprocessor (9-bit) mode functions. 6. set the multiprocessor mode select (mpen) to enable multiprocessor mode. 7. write to the uart control 0 register to: ? set the transmit enable bit (ten) to enable the uart for data transmission ? enable parity, if appropriate and if multiprocessor mode is not enabled, and select either even or odd parity
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 91 ? set or clear the ctse bit to enable or disable control from the remote receiver via the cts pin ? 8. execute an ei instruc tion to enable interrupts. ? the uart is now configured for interrupt-d riven data transmission. because the uart transmit data register is empty, an interru pt is generated immediately. when the uart transmit interrupt is detected, the associated interrupt service rout ine performs the follow- ing functions: 1. write the uart control 1 register to select the outgoing address bit: ? set the multiprocessor bit transmitter (mpbt) if sending an address byte; clear it if sending a data byte. ? 2. write the data byte to the uart transm it data register. the transmitter automati- cally transfers the data to the transmit shift register and transmits the data. 3. clear the uart transmit interrupt bit in th e applicable interrupt request register. 4. execute the iret instruction to return from the interrupt service routine and wait for the transmit data register to again become empty. receiving data usin g the polled method observe the following procedure to configure the uart for polled data reception: 1. write to the uart baud rate high and low byte registers to set the appropriate baud rate. 2. enable the uart pin functions by config uring the associated gpio port pins for alternate function operation. 3. write to the uart control 1 register to enable multiprocessor mode func- tions, if appropriate. 4. write to the uart control 0 register to: ? set the receive enable bit (ren) to enable the uart for data reception ? enable parity, if appropriate and if multiprocessor mode is not enabled, and select either even or odd parity ? 5. check the rda bit in the uart status 0 register to determine if the receive data register contains a valid data byte (indicat ed by a 1). if rda is set to 1 to indicate available data, continue to step 6 . if the receive data register is empty (indicated by a 0), continue to monito r the rda bit awaiting reception of the valid data.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 92 6. read data from the uart receive data register. if operating in multiproces- sor (9-bit) mode, further actions may be required depending on the multipro- cessor mode bits mpmd[1:0]. 7. return to step 5 to receive additional data. receiving data using the interrupt-driven method the uart receiver interrupt indicates the av ailability of new data (as well as error con- ditions). observe the following procedure to configure the uart receiver for interrupt- driven operation: 1. write to the uart baud rate high and low byte registers to set the appropriate baud rate. 2. enable the uart pin functions by config uring the associated gpio port pins for alternate function operation. 3. execute a di instruction to disable interrupts. 4. write to the interrupt control registers to enable the uart receiver interrupt and set the appropriate priority. 5. clear the uart receiver interrupt in th e applicable interrupt request register. 6. write to the uart control 1 register to enable multiprocessor (9-bit) mode functions, if appropriate. ? set the multiprocessor mode select (mpen) to enable multiproces- sor mode. ? set the multiprocessor mode bits, mp md[1:0], to select the appropriate address matching scheme. ? configure the uart to interrupt on received data and errors or errors only (inter- rupt on errors only is unlikel y to be useful for z8 en core! xp devices without a dma block). 7. write the device address to the address compare register (aut omatic multiprocessor modes only). 8. write to the uart control 0 register to: ? set the receive enable bit (ren) to enable the uart for data reception ? enable parity, if appropriate and if multiprocessor mode is not enabled, and select either even or odd parity ? 9. execute an ei instruc tion to enable interrupts.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 93 the uart is now configured for interrupt-driven data reception. when the uart receiver interrupt is detected, the associated interrupt service routin e performs the follow- ing functions: 1. check the uart status 0 register to dete rmine the source of the interrupt: error, break, or received data. 2. if the interrupt was caused by data available, read the data from the uart receive data register. if operating in multiproce ssor (9-bit) mode, further actions may be required depending on the mult iprocessor mode bits mpmd[1:0]. 3. clear the uart receiver interrupt in th e applicable interrupt request register. 4. execute the iret instruction to return from the interrupt service routine and await more data. clear to send ( cts ) operation the cts pin, if enabled by the ctse bit of the uart control 0 register, performs flow control on the outgoing transmit datastream. the clear to send (cts ) input pin is sam- pled one system clock before beginning any new character transmission. to delay trans- mission of the next data character, an external receiver must deassert cts at least one system clock cycle before a new data transm ission begins. for multiple character trans- missions, this would typically be done during stop bit transmission. if cts deasserts in the middle of a character transmission, the current character is sent completely. multiprocessor (9-bit) mode the uart has a multiprocessor (9-bit) mode that uses an extra (9th) bit for selec- tive communication when a number of proce ssors share a common uart bus. in multi- processor mode (also referred to as 9-bit mode), the multiprocessor bit (mp) is transmitted immediately following the 8 bits of data and immediately preceding the stop bit(s); the character format is displayed in figure 16. figure 16. uart asynchronous multiprocessor mode data format start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 mp data field lsb msb idle state of line stop bit(s) 1 2 1 0
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 94 in multiprocessor (9-bit) mode, the parity bit location (9th bit) becomes the mul- tiprocessor control bit. the uart control 1 and status 1 registers provide multi- processor (9-bit) mode control and status information. if an automatic address matching scheme is enable d, the uart address compare register holds the network address of the device. multiprocessor (9-bit) mode receive interrupts when multiprocessor mode is enabled, the uart only processes frames addressed to it. the determination of whether a frame of data is addressed to the uart can be made in hardware, software or so me combination of the two, depending on the multiprocessor configuration bits. in general, the address co mpare feature reduces the load on the cpu, since it does not need to access the uart when it receives data directed to other devices on the multinode network. the following three multiprocessor modes are available in hardware: ? interrupt on all address bytes ? interrupt on matched address bytes and correctly framed data bytes ? interrupt only on corre ctly framed data bytes ? these modes are selected with mpmd[1:0] in the uart control 1 register. for all multiprocessor modes, bit mpen of the uart control 1 register must be set to 1. the first scheme is enabled by writing 01b to mpmd[1:0]. in th is mode, all incoming address bytes cause an interrupt, while data bytes never cause an interrupt. the interrupt service routine must manually check the addre ss byte that caused triggered the interrupt. if it matches the uart address, the software cl ears mpmd[0]. at this point, each new incoming byte interrupts the cp u. the software is then re sponsible for determining the end of the frame. it checks fo r end-of-frame by reading the mprx bit of the uart status 1 register for each incoming byte. if mprx=1, a new frame has begun. if the address of this new frame is different from the uart?s address, then set mpmd[0] to 1 causing the uart interrupts to go inactiv e until the next address byte . if the new frame?s address matches the uart?s, the data in the new frame is processed as well. the second scheme is enabled by setting mpmd[1:0] to 10b and writing the uart?s address into the uart address co mpare register. this mode introduces more hardware control, interrupting only on frames that match the uart?s address. when an incoming address byte does not match the uart?s address, it is ignored. all successive data bytes in this frame are also ignored. wh en a matching address byte oc curs, an interrupt is issued and further interrupts now occur on each successive data byte. the first data byte in the frame contains the newfrm = 1 in the uart status 1 register. when the next address byte occurs, the hardware comp ares it to the uart?s address. if there is a match, the inter- rupts continue sand the newfrm bit is set fo r the first byte of the new frame. if there is no match, then the uart ignores all in coming bytes until the next address match.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 95 the third scheme is enable d by setting mpmd[1:0] to 11b and by writing the uart?s address into the uart address co mpare register. this mode is identical to the second scheme, except that there are no interrupts on address bytes. the first data byte of each frame is still accompanie d by a newfrm assertion. external driver enable the uart provides a driver enable (de) si gnal for off-chip bus transceivers. this fea- ture reduces the software overhead associated with using a gpio pin to control the trans- ceiver when communicating on a mu ltitransceiver bus, such as rs-485. driver enable is an active high signal that envelopes the entire transmitted data frame including parity and stop bits as displayed in figure 17. the driver enable signal asserts when a byte is written to the uart transm it data register. the driver enable signal asserts at least one uart bit period and no greater than two uart bit periods before the start bit is transmitted. this timing allows a setup time to enable the transceiver. the driver enable signal deasserts one system clock period after the last stop bit is transmit- ted. this one system clock delay allows both time for data to clear the transceiver before disabling it, as well as the ability to determine if another character follows the current character. in the event of back to back characters (new data must be written to the trans- mit data register before the previous character is completely transmitte d) the de signal is not deasserted between characters. the depo l bit in the uart control register 1 sets the polarity of the driver enable signal. the driver enable-to-start-bit set-up time is calculated as: figure 17. uart driver enable signal timing (shown with 1 stop bit and parity) start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity data field lsb msb idle state of line stop bit 1 1 0 0 1 de 1 baud rate (hz) ------------------------------------- ?? ?? de to start bit setup time (s) 2 baud rate (hz) ------------------------------------- ?? ?? ??
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 96 uart interrupts the uart features separate interrupts for the transmitter and the rece iver. in addition, when the uart primary functionality is disabled, the baud rate generator can also func- tion as a basic timer with interrupt capability. transmitter interrupts the transmitter generates a single interrupt when the transmit data register empty bit (tdre) is set to 1. this indicates that the transmitter is ready to accept new data for trans- mission. the tdre interrupt occurs after the transmit shift register has shifted the first bit of data out. at this point, the transmit data register can be written with the next char- acter to send. this provides 7 bit-periods of latency to load the transmit data register before the transmit shift regist er completes shifting the current character. writing to the uart transmit data register clears the tdre bit to 0. receiver interrupts the receiver generates an interrupt when any of the following events occurs: ? a data byte has been received and is availa ble in the uart receive data register. this interrupt can be disabled independent of the other receiver interrupt sources. the re- ceived data interrupt occurs once the receive character has been received and placed in the receive data register. software must re spond to this received data available con- dition before the next character is comple tely received to avoid an overrun error. in multiprocessor mode (mpen = 1), the r eceive data interrupts are dependent on the multiprocessor configuration and the most recent address byte. ? a break is received ? an overrun is detected ? a data framing error is detected uart overrun errors when an overrun error conditio n occurs the uart prevents overwriting of the valid data currently in the receive data register. the br eak detect and overrun status bits are not displayed until after the va lid data has been read. after the valid data has been read, the uart st atus 0 register is updated to indicate the overrun condition (and break detect, if applicable ). the rda bit is set to 1 to indicate that the receive data register contains a data byte. however, because the overrun error occurred, this byte may not contain valid da ta and should be ignor ed. the brkd bit indi- cates if the overrun was caused by a break condition on the line. after reading the status note:
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 97 byte indicating an overrun error, the receive data register must be read again to clear the error bits is the uart status 0 register. upda tes to the receive data register occur only when the next data word is received. uart data and error handling procedure figure 18 displays the recommended procedur e for use in uart receiver interrupt service routines. baud rate gene rator interrupts if the baud rate generator interrupt enable is set, the uart receiver interrupt asserts when the uart baud rate generator reloads. this action allows th e baud rate genera- tor to function as an additional counter if the uart functionality is not employed. figure 18. uart receiver in terrupt service routine flow receiver errors? no yes read status discard data read data which interrupt receiver ready clears rda bit and resets error bits read data
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 98 uart baud ra te generator the uart baud rate generator creates a lowe r frequency baud rate clock for data trans- mission. the input to the baud rate generator is the system clock. the uart baud rate high and low byte registers combine to cr eate a 16-bit baud rate divisor value (brg[15:0]) that sets the data transmission rate (baud rate) of the uart. the uart data rate is calculated usin g the following equation: when the uart is disabled, the baud rate ge nerator can function as a basic 16-bit timer with interrupt on time-out. to configure the ba ud rate generator as a timer with interrupt on time-out, complete the following procedure: 1. disable the uart by clearing the ren and ten bits in the uart control 0 register to 0. 2. load the appropriate 16-bit count value in to the uart baud rate high and low byte registers. 3. enable the baud rate generator timer fu nction and associated interrupt by setting the brgctl bit in the uart control 1 register to 1. ? when configured as a general purpose timer, th e interrupt interval is calculated using the following equation: uart control register definitions the uart control registers support the uart and the associated infrared encoder/ decoders. for more info rmation about the infrare d operation, see the infrared encoder/ decoder chapter on page 109. uart transmit data register data bytes written to the uart transmit data re gister, shown in table 53, are shifted out on the txd x pin. the write-only uart transmit da ta register shares a register file address with the read-only uart receive data register. uart data rate (bits/s) system clock frequency (hz) 16 uart baud rate divisor value ? ------------------------------------------------------------------------------------------ = interrupt interval s ?? system clock period (s) brg 15:0 ?? ? =
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 99 uart receive data register data bytes received through the rxd x pin are stored in the uart receive data register, shown in table 54. the read-only uart receive data register shares a register file address with the write-only uart transmit data register. table 53. uart transmit data register (u x txd) bit 7 6 5 4 3 2 1 0 field txd reset x r/w w address f40h and f48h bit description [7:0] ? txd transmit data uart transmitter data byte to be shifted out through the txd x pin. table 54. uart receive data register (u x rxd) bit 7 6 5 4 3 2 1 0 field rxd reset x r/w r address f40h and f48h bit description [7:0] ? rxd receive data uart receiver data byte from the rxd x pin.
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 100 uart status 0 register the uart status 0 register, shown in tabl e 55, identifies the current uart operating configuration and status. table 55. uart status 0 register (u x stat0) bit 7 6 5 4 3 2 1 0 field rda pe oe fe brkd tdre txe cts reset 01x r/w r address f41h and f49h bit description [7] ? rda receive data available this bit indicates that the uart receive data register has received data. reading the uart receive data register clears this bit. 0 = the uart receive data register is empty. 1 = there is a byte in the uart receive data register. [6] ? pe parity error this bit indicates that a parity error has occu rred. reading the uart receive data register clears this bit. 0 = no parity error occurred. 1 = a parity error occurred. [5] ? oe overrun error this bit indicates that an overrun error has occurred. an overrun occurs when new data is received and the uart receive data register has not been read. if the rda bit is reset to 0, then reading the uart receive da ta register clears this bit. 0 = no overrun error occurred. 1 = an overrun error occurred. [4] ? fe framing error this bit indicates that a framing error (no stop bit following data reception) was detected. read- ing the uart receive data register clears this bit. 0 = no framing error occurred. 1 = a framing error occurred. [3] ? brkd break detect this bit indicates that a break occurred. if the data bits, parity/multiprocessor bit, and stop bit(s) are all zeros then this bit is se t to 1. reading the uart receive data register clears this bit. 0 = no break occurred. 1 = a break occurred.
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 101 uart status 1 register the uart status 1 register, shown in ta ble 56, contains multip rocessor control and uart status bits. [2] ? tdre transmitter data register empty this bit indicates that the uart transmit data register is empty and ready for additional data. writing to the uart transmit da ta register resets this bit. 0 = do not write to the uart transmit data register. 1 = the uart transmit data register is ready to receive an additional byte to be transmitted. [1] ? txe transmitter empty this bit indicates that the transmit shift regist er is empty and character transmission is fin- ished. 0 = data is curren tly transmitting. 1 = transmission is complete. [0] ? cts cts signal when this bit is read, it returns the level of the cts signal. table 56. uart status 1 register (u x stat1) bit 7 6 5 4 3 2 1 0 field reserved newfrm mprx reset 0 r/w rr/wr address f44h and f4ch bit description [7:2] reserved these bits are reserved and must be programmed to 000000. [1] ? newfrm new frame status bit denoting the start of a new frame. reading the uart receive data register resets this bit to 0. 0 = the current byte is not the first data byte of a new frame. 1 = the current byte is the first data byte of a new frame. [0] ? mprx multiprocessor receive returns the value of the last multiprocessor bit received. r eading from the uart receive data register resets this bit to 0. bit description (continued)
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 102 uart control 0 and control 1 registers the uart control 0 and control 1 registers, shown in tables 57 and 58, configure the properties of the uart?s transmit and recei ve operations. the uar t control registers must not been written while the uart is enabled. table 57. uart control 0 register (u x ctl0) bit 7 6 5 4 3 2 1 0 field ten ren ctse pen psel sbrk stop lben reset 0 r/w r/w address f42h and f4ah bit description [7] ? ten transmit enable this bit enables or disables the transmitter. the enable is also controlled by the cts signal and the ctse bit. if the cts signal is low and the ctse bit is 1, the transmitter is enabled. 0 = transmitter disabled. 1 = transmitter enabled. [6] ? ren receive enable this bit enables or disables the receiver. 0 = receiver disabled. 1 = receiver enabled. [5] ? ctse cts enable 0 = the cts signal has no effect on the transmitter. 1 = the uart recognizes the cts signal as an enable control from the transmitter. [4] ? pen parity enable this bit enables or disables pa rity. even or odd is determined by the psel bit. it is overridden by the mpen bit. 0 = parity is disabled. 1 = the transmitter sends data with an additional parity bit and the receiver receives an addi- tional parity bit. [3] ? psel parity select 0 = even parity is transmitted and expected on all received data. 1 = odd parity is transmitted and expected on all received data. [2] ? sbrk send break this bit pauses or breaks data transmission. sending a break interrupts any transmission in progress, so ensure that the transmitter has fi nished sending data before setting this bit. 0 = no break is sent. 1 = the output of the transmitter is zero.
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 103 [1] ? stop stop bit select 0 = the transmitter sends one stop bit. 1 = the transmitter sends two stop bits. [0] ? lben loop back enable 0 = normal operation. 1 = all transmitted data is lo oped back to the receiver. table 58. uart control 1 register (u x ctl1) bit 7 6 5 4 3 2 1 0 field mpmd[1] mpen mpmd[0] mpbt depol brgctl rdairq iren reset 0 r/w r/w address f43h and f4bh bit description [7,5] ? mpmd[1,0] multiprocessor mode if multiprocessor (9-bit) mode is enabled, 00 = the uart generates an interrupt request on all received bytes (data and address). 01 = the uart generates an interrupt request only on received address bytes. 10 = the uart generates an interrupt request when a received address byte matches the value stored in the address compare register and on all successive data bytes until an address mismatch occurs. 11 = the uart generates an interrupt request on all received data bytes for which the most recent address byte matched the val ue in the address compare register. [6] ? mpen multiprocessor (9-bit) enable this bit is used to enable multiprocessor (9-bit) mode. 0 = disable multipro cessor (9-bit) mode. 1 = enable multiprocessor (9-bit) mode. [4] ? mpbt multiprocessor bit transmit this bit is applicable only when mu ltiprocessor (9-bit) mode is enabled. 0 = send a 0 in the multiprocessor bit location of the data stream (9th bit). 1 = send a 1 in the multiprocessor bit location of the data stream (9th bit). [3] ? depol driver enable polarity 0 = de signal is active high. 1 = de signal is active low. bit description (continued)
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 104 [2] ? brgctl baud rate control this bit causes different uart behavior dep ending on whether the uart receiver is enabled (ren = 1 in the uart control 0 register ). when the uart receiver is not enabled, this bit determines whether the baud rate generator issues interrupts. 0 = reads from the baud rate high and low byte registers return the brg reload value 1 = the baud rate generator generates a receive interrupt when it counts down to 0. reads from the baud rate high and low byte registers return the current brg count value. when the uart receiver is enabled, this bit a llows reads from the ba ud rate registers to return the brg count value instead of the reload value. 0 = reads from the baud rate high and low byte registers return the brg reload value. 1 = reads from the baud rate high and low byte registers return the current brg count value. unlike the timers, there is no mech anism to latch the high byte when the low byte is read. [1] ? rdairq receive data interrupt enable 0 = received data and receiver errors generates an interrupt request to the interrupt con- troller. 1 = received data does not generate an interrupt request to the interrupt controller. only receiver errors generate an interrupt request. [0] ? iren infrared encoder/decoder enable 0 = infrared encoder/decoder is disabled. uart operates normally operation. 1 = infrared encoder/decoder is enabled. the uart transmits and receives data through the infrared encoder/decoder. bit description (continued)
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 105 uart address compare register the uart address compare register, shown in table 59, stores the multinode network address of the uart. when the mpmd[1] b it of uart control register 0 is set, all incoming address bytes are compared to the value stored in the address compare regis- ter. receive interrupts and rda assertions only occur in the event of a match. uart baud rate high and low byte registers the uart baud rate high and low byte registers, shown in tables 60 and 61, combine to create a 16-bit baud rate divisor value (brg [15:0]) that sets the da ta transmission rate (baud rate) of the uart. to configure the baud rate generator as a timer with interrupt on time-out, complete the following procedure: 1. disable the uart by clearing the ren and ten bits in the uart control 0 register to 0. 2. load the appropriate 16-bit count value in to the uart baud rate high and low byte registers. 3. enable the baud rate generator timer fu nction and associated interrupt by setting the brgctl bit in the uart control 1 register to 1. ? when configured as a general-purpose timer, the uart brg interrupt interval is calcu- lated using the following equation: table 59. uart address compare register (u x addr) bit 7 6 5 4 3 2 1 0 field comp_addr reset 0 r/w r/w address f45h and f4dh bit description [7:0] ? comp_addr compare address this 8-bit value is compared to the incoming address bytes. uart brg interrupt interval s ?? system clock period (s) brg 15:0 ?? ? =
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 106 for a given uart data rate, the integer baud ra te divisor value is calculated using the fol- lowing equation: the baud rate error relative to the appropriate baud rate is calculated using the following equation: for reliable communication, the uart baud ra te error must never exceed 5 percent. table 62 lists data rate errors for popular ba ud rates and commonly used crystal oscillator frequencies. table 60. uart baud rate high byte register (u x brh) bit 7 6 5 4 3 2 1 0 field brh reset 1 r/w r/w address f46h and f4eh table 61. uart baud rate low byte register (u x brl) bit7 7 6 5 4 3 2 1 0 field brl reset 1 r/w r/w address f47h and f4fh uart baud rate divisor value (brg) round system clock frequency (hz) 16 uart data rate (bits/s) ? ------------------------------------------------------------------------ ?? ?? = uart baud rate error (%) 100 actual data rate desired data rate ? desired data rate ------------------------------------------------------------------------------------------ - ?? ?? ? =
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 107 table 62. uart baud rates 20.0 mhz system clock 18.432 mhz system clock desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) 1250.0 1 1250.0 0.00 1250.0 1 1152.0 ?7.84% 625.0 2 625.0 0.00 625.0 2 576.0 ?7.84% 250.0 5 250.0 0.00 250.0 5 230.4 ?7.84% 115.2 11 113.6 ?1.36 115.2 10 115.2 0.00 57.6 22 56.8 ?1.36 57.6 20 57.6 0.00 38.4 33 37.9 ?1.36 38.4 30 38.4 0.00 19.2 65 19.2 0.16 19.2 60 19.2 0.00 9.60 130 9.62 0.16 9.60 120 9.60 0.00 4.80 260 4.81 0.16 4.80 240 4.80 0.00 2.40 521 2.40 ?0.03 2.40 480 2.40 0.00 1.20 1042 1.20 ?0.03 1.20 960 1.20 0.00 0.60 2083 0.60 0.02 0.60 1920 0.60 0.00 0.30 4167 0.30 ?0.01 0.30 3840 0.30 0.00 16.667 mhz system clock 11.0592 mhz system clock desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) 1250.0 1 1041.69 ?16.67 1250.0 n/a n/a n/a 625.0 2 520.8 ?16.67 625.0 1 691.2 10.59 250.0 4 260.4 4.17 250.0 3 230.4 ?7.84 115.2 9 115.7 0.47 115.2 6 115.2 0.00 57.6 18 57.87 0.47 57.6 12 57.6 0.00 38.4 27 38.6 0.47 38.4 18 38.4 0.00 19.2 54 19.3 0.47 19.2 36 19.2 0.00 9.60 109 9.56 ?0.45 9.60 72 9.60 0.00 4.80 217 4.80 ?0.83 4.80 144 4.80 0.00 2.40 434 2.40 0.01 2.40 288 2.40 0.00 1.20 868 1.20 0.01 1.20 576 1.20 0.00 0.60 1736 0.60 0.01 0.60 1152 0.60 0.00 0.30 3472 0.30 0.01 0.30 2304 0.30 0.00
ps019924-0113 p r e l i m i n a r y uart control register definitions z8 encore! xp ? f64xx series product specification 108 10.0 mhz system clock 5.5296 mhz system clock desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) 1250.0 n/a n/a n/a 1250.0 n/a n/a n/a 625.0 1 625.0 0.00 625.0 n/a n/a n/a 250.0 3 208.33 ?16.67 250.0 1 345.6 38.24 115.2 5 125.0 8.51 115.2 3 115.2 0.00 57.6 11 56.8 ?1.36 57.6 6 57.6 0.00 38.4 16 39.1 1.73 38.4 9 38.4 0.00 19.2 33 18.9 0.16 19.2 18 19.2 0.00 9.60 65 9.62 0.16 9.60 36 9.60 0.00 4.80 130 4.81 0.16 4.80 72 4.80 0.00 2.40 260 2.40 ?0.03 2.40 144 2.40 0.00 1.20 521 1.20 ?0.03 1.20 288 1.20 0.00 0.60 1042 0.60 ?0.03 0.60 576 0.60 0.00 0.30 2083 0.30 0.2 0.30 1152 0.30 0.00 3.579545 mhz system clock 1.8432 mhz system clock desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) desired rate (khz) brg divisor (decimal) actual rate (khz) error (%) 1250.0 n/a n/a n/a 1250.0 n/a n/a n/a 625.0 n/a n/a n/a 625.0 n/a n/a n/a 250.0 1 223.72 ?10.51 250.0 n/a n/a n/a 115.2 2 111.9 ?2.90 115.2 1 115.2 0.00 57.6 4 55.9 ?2.90 57.6 2 57.6 0.00 38.4 6 37.3 ?2.90 38.4 3 38.4 0.00 19.2 12 18.6 ?2.90 19.2 6 19.2 0.00 9.60 23 9.73 1.32 9.60 12 9.60 0.00 4.80 47 4.76 ?0.83 4.80 24 4.80 0.00 2.40 93 2.41 0.23 2.40 48 2.40 0.00 1.20 186 1.20 0.23 1.20 96 1.20 0.00 0.60 373 0.60 ?0.04 0.60 192 0.60 0.00 0.30 746 0.30 ?0.04 0.30 384 0.30 0.00 table 62. uart baud rates (continued)
ps019924-0113 p r e l i m i n a r y infrared encoder/decoder z8 encore! xp ? f64xx series product specification 109 infrared encoder/decoder the z8 encore! xp f64xx seri es products contain two fully-functional, high-performance uart-to-infrared encoders/decod ers (endecs). each infrared endec is integrated with an on-chip uart to allow easy communication between the z8 encore! xp f64xx series and irda physical layer specification version 1.3-compliant infrared transceivers. infra- red communication provides se cure, reliable, low-cost, po int-to-point communication between pcs, pdas, cell phones, printers , and other infrared enabled devices. architecture figure 19 displays the architecture of the infrared endec. operation when the infrared endec is enabled, the tr ansmit data from the associated on-chip uart is encoded as digital signals in accordance with the irda standard and output to the infra- red transceiver via the txd pin. likewise, da ta received from the infrared transceiver is passed to the infrared endec vi a the rxd pin, decoded by th e infrared endec, and then figure 19. infrared data communication system block diagram interrupt signal rxd txd infrared encoder/decoder uart rxd txd system clock i/o address data infrared transceiver rxd txd baud rate clock (endec) zilog zhx1810
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 110 passed to the uart. communication is hal f-duplex, which means simultaneous data transmission and reception is not allowed. the baud rate is set by the uart?s baud rate generator and supports irda standard baud rates from 9600 baud to 115.2 kbaud. higher baud rates are possible, but do not meet irda specifications. the uart must be enabled to use the infrared endec. the infrared endec data rate is calculated using the following equation: transmitting irda data the data to be transmitted using the infrared transceiver is first se nt to the uart. the uart?s transmit signal (txd) and baud rate clock are used by the irda to generate the modulation signal (ir_txd) that drives th e infrared transceiver. each uart/infrared data bit is 16-clock wide. if the data to be transmitted is 1, the ir_txd signal remains low for the full 16-clock peri od. if the data to be transmitted is 0, a 3-clock high pulse is output following a 7-clock low period. after the 3-clock high pulse, a 6-clock low pulse is output to complete the full 16-clock data period. figure 20 displays irda data transmission. when the infrared endec is enabled, the uart?s txd signal is internal to the z8 encore! xp f64xx series products while the ir_txd signal is output through the txd pin. figure 20. infrared data transmission infrared data rate (bits/s) system clock frequency (hz) 16 uart baud rate divisor value ? ------------------------------------------------------------------------------------------ = baud rate ir_txd uart?s 16-clock period start bit = 0 data bit 0 = 1 data bit 1 = 0 data bit 2 = 1 data bit 3 = 1 7-clock delay 3-clock pulse txd clock
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 111 receiving irda data data received from the infrared transceiver via the ir_rxd signal through the rxd pin is decoded by the infrared endec and passed to the uart. the uart?s baud rate clock is used by the infrared endec to generate the demodulated signal (rxd) that drives the uart. each uart/infrared data bit is 16-clock s wide. figure 21 displays data reception. when the infrared endec is enabled, the uart?s rxd signal is internal to the z8 encore! xp f64xx series products wh ile the ir_rxd signal is received through the rxd pin. the system clock frequency must be at least 1.0 mhz to ensure proper reception of the 1.6 s minimum width pulses allowed by the irda standard. endec receiver synchronization the irda receiver uses a local baud rate clock co unter (0 to 15 clock periods) to generate an input stream for the uart and to create a sampling window for detection of incoming pulses. the generated uart input (uart rxd) is delayed by 8 baud rate clock periods with respect to the incoming irda data stream. when a fa lling edge in the input data stream is detected, the endec counter is reset . when the count reaches a value of 8, the uart rxd value is updated to reflect the va lue of the decoded data. when the count reaches 12 baud clock periods, the sampling window for the next incoming pulse opens. the window remains open until th e count again reaches 8 (i.e., 24 baud clock periods figure 21. infrared data reception baud rate uart?s ir_rxd 16-clock period start bit = 0 data bit 0 = 1 data bit 1 = 0 data bit 2 = 1 data bit 3 = 1 8-clock delay clock rxd 16-clock period 16-clock period 16-clock period 16-clock period start bit = 0 data bit 0 = 1 data bit 1 = 0 data bit 2 = 1 data bit 3 = 1 min. 1.6s pulse caution:
ps019924-0113 p r e l i m i n a r y infrared encoder/decoder control register z8 encore! xp ? f64xx series product specification 112 since the previous pulse was detected). this gives the ende c a sampling window of minus four baud rate clocks to plus eight baud rate clocks around the expected time of an incom- ing pulse. if an incoming pulse is detected in side this window this process is repeated. if the incoming data is a logical 1 (no pulse), the endec return s to the initial state and waits for the next falling edge. as each falling edge is detected, the endec cl ock counter is reset, resynchronizing the endec to the incoming sign al. this action allows the endec to tolerate jitter and baud rate errors in the incoming data stream. resynchr onizing the endec does not alter the operation of the uart, which ultimately receives the data. the uart is only synchronized to the inco ming data stream when a start bit is received. infrared encoder/decoder co ntrol register definitions all infrared endec configuration and status in formation is set by the uart control regis- ters as defined in the uart control register definitions section on page 98. to prevent spurious signals during irda da ta transmission, set the iren bit in the uartx control 1 register to 1 to enable the infrared encoder/decoder before enabling the gpio port alternate func tion for the corresponding pin. caution:
ps019924-0113 p r e l i m i n a r y serial peripheral interface z8 encore! xp ? f64xx series product specification 113 serial peripheral interface the serial peripheral interface is a synchr onous interface allowi ng several spi-type devices to be interconnect ed. spi-compatible devices incl ude eeproms, analog-to-dig- ital converters, and isdn devices. features of the spi include: ? full-duplex, synchronous, character-oriented communication ? four-wire interface ? data transfers rates up to a maximum of one-half the system clock frequency ? error detection ? dedicated baud rate generator architecture the spi may be configured as either a master (in single or multimaster systems) or a slave as displayed in figures 22 through 24. figure 22. spi configured as a master in a single-master, single-slave system spi master 8-bit shift register bit 0 bit 7 miso mosi sck ss to slave?s ss pin from slave to slave to slave baud rate generator
ps019924-0113 p r e l i m i n a r y architecture z8 encore! xp ? f64xx series product specification 114 figure 23. spi configured as a master in a single-master, multiple-slave system figure 24. spi configured as a slave spi master 8-bit shift register bit 0 bit 7 miso mosi sck gpio to slave #2?s ss pin from slave to slave to slave ss baud rate generator v cc gpio to slave #1?s ss pin spi slave 8-bit shift register bit 7 bit 0 miso mosi sck ss from master to master from master from master
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 115 operation the spi is a full-duplex, synchronous, characte r-oriented channel that supports a four-wire interface (serial clock, transmit, receive an d slave select). the spi block consists of a transmit/receive shift register, a baud ra te (clock) generator and a control unit. during an spi transfer, data is sent and recei ved simultaneously by both the master and the slave spi devices. separate signals are requ ired for data and the serial clock. when an spi transfer occurs, a multibit (typically 8-bit) character is shifted out one data pin and an multibit character is simultaneously shifted in on a second data pin. an 8-bit shift register in the master and another 8-bit shift register in the slave are connected as a circular buffer. the spi shift register is single-buffered in the transmit and receive directions. new data to be transmitted cannot be written into the sh ift register until the previous transmission is complete and receive data (if valid) has been read. spi signals the four basic spi signals are: ? master-in/slave-out ? master-out/slave-in ? serial clock ? slave select ? each signal is described in both master and slave modes. master-in/slave-out the master-in/slave-out (miso) pin is configur ed as an input in a master device and as an output in a slave device. it is one of the tw o lines that transfer serial data, with the most significant bit sent first. the miso pin of a slave device is placed in a high-impedance state if the slave is not selected. when the sp i is not enabled, this signal is in a high- impedance state. master-out/slave-in the master-out/slave-in (mosi) pin is configured as an output in a master device and as an input in a slave device. it is one of the tw o lines that transfer serial data, with the most significant bit sent first. when the spi is not enabled, this signal is in a high-impedance state.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 116 serial clock the serial clock (sck) synchronizes data movement both in and out of the device through its mosi and miso pins. in master mode, the spi?s baud rate generator cre- ates the serial clock. the master drives the serial clock out its own sck pin to the slave?s sck pin. when the spi is configured as a slav e, the sck pin is an input and the clock sig- nal from the master synchronizes the data tran sfer between the master and slave devices. slave devices ignore the sck signal, unless the ss pin is asserted. when configured as a slave, the spi block requires a minimum sck pe riod of greater than or equal to 8 times the system (x in ) clock period. the master and slave are each capable of exchanging a character of data during a sequence of numbits clock cycles (see the numbits field in the s pi mode register section on page 125). in both master and slave spi devices, data is shifted on one edge of the sck and is sampled on the opposite edge wh ere data is stable. edge polarity is deter- mined by the spi phase and polarity control. slave select the active low slave select (ss ) input signal selects a slave spi device. ss must be low prior to all data communication to and from the slave device. ss must stay low for the full duration of each character transferred. the ss signal may stay low during the transfer of multiple characters or may deassert between each character. when the spi is configured as the only master in an spi system, the ss pin can be set as either an input or an output. other gpio output pins can also be employed to select exter- nal spi slave devices. when the spi is configured as one m aster in a multimaster spi system, the ss pin must be set as an input. the ss input signal on the master must be high. if the ss signal goes low (indicating another master is driving the spi bu s), a collision error flag is set in the spi status register. spi clock phase and polarity control the spi supports four combinations of serial cl ock phase and polarity using two bits in the spi control register. the clock polarity bit, clkpol, selects an active high or active low clock and has no effect on the transfer format. table 63 lists the spi clock phase and polarity operation parameters . the clock phase bit, phase, selects one of two fundamen- tally different transfer formats. for proper da ta transmission, the clock phase and polarity must be identical for the spi master and the spi slave. the master always places data on the mosi line a half-cycle befo re the receive clock edge (sck signal), in order for the slave to latch the data.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 117 transfer format phase equals zero figure 25 displays the timing di agram for an spi transfer in which phase is cleared to 0. the two sck waveforms show polarity with clkpol reset to 0 and with clkpol set to one. the diagram may be interpreted as either a master or slave timing diagram because the sck master-in/slave-out (m iso) and master-out/slave-in (mosi) pins are directly connected between the master and the slave. table 63. spi clock phase (phase) and clock polarity (clkpol) operation phase clkpol sck transmit edge sck receive edge sck idle state 0 0 falling rising low 0 1 rising falling high 1 0 rising falling low 1 1 falling rising high figure 25. spi timing when phase is 0 sck (clkpol = 0) sck (clkpol = 1) bit7 bit6 bit5 bit4 bit3 bi t2 bit1 bit0 mosi bit7 bit6 bit5 bit4 bit3 bi t2 bit1 bit0 miso input sample time ss
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 118 transfer format phase equals one figure 26 displays the timing diagram for an spi transfer in which phase is 1. two waveforms are depicted for sck, one for cl kpol reset to 0 and another for clkpol set to 1. multimaster operation in a multimaster spi system, all sck pins are tied together, all mosi pins are tied together and all miso pins are tied together. all spi pins must then be configured in open-drain mode to prevent bus contention . at any one time, only one spi device is configured as the master and all other spi de vices on the bus are configured as slaves. the master enables a single slave by asserting the ss pin on that slave only. then, the single master drives data out its sck and mo si pins to the sck and mosi pins on the slaves (including those which are not enable d). the enabled slave drives data out its miso pin to the miso master pin. for a master device operating in a multimaster system, if the ss pin is configured as an input and is driven low by another master, the col bit is set to 1 in the spi status regis- ter. the col bit indicates the occurrence of a multimaster collision (mode fault error con- dition). figure 26. spi timing when phase is 1 sck (clkpol = 0) sck (clkpol = 1) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 mosi bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 miso input sample time ss
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 119 slave operation the spi block is configured for slave mode operation by setting the spien bit to 1 and the mmen bit to 0 in the sp ictl register and setting the ssio bit to 0 in the spimode ? register. the irqe, phase, clkpol, wor bits in the spictl register and the numbits field in the spimode register must be set to be consistent with the other spi devices. the str bit in the spictl register may be used if appropriate to force a start- up interrupt. the birq bit in the spictl regi ster and the ssv bit in the spimode reg- ister are not used in slave mode. the spi baud rate generator is not used in slave mode so the spibrh and spibrl re gisters need not be initialized. if the slave has data to send to the master, the data must be written to the spidat register before the transaction starts (first edge of sck when ss is asserted). if the spidat regis- ter is not written prior to the slave transaction, the miso pin outputs whatever value is currently in the spidat register. due to the delay resulting from synchronization of the spi input signals to the internal sys- tem clock, the maximum spiclk baud rate th at can be supported in slave mode is the system clock frequency (x in ) divided by 8. this rate is controlled by the spi master. error detection the spi contains error detection logic to support spi communication protocols and recog- nize when communication errors have occurred. the spi status register indicates when a data transmission error has been detected. overrun (write collision) an overrun error (write collision) indicates that a write to the spi data register was attempted while a data transfer was in prog ress (in either master or slave modes). an overrun sets the ovr bit in the spi status re gister to 1. writing a 1 to ovr clears this error flag. the data register is not altered wh en a write occurs while data transfer is in progress. mode fault (multimaster collision) a mode fault indicates when more than one master is trying to communicate at the same time (a multimaster collision). the mode fault is detected when the enabled master?s ss pin is asserted. a mode fault se ts the col bit in the spi status register to 1. writing a 1 to col clears this error flag. slave mode abort in the slave mode of operation, if the ss pin deasserts before all bits in a character have been transferred, the transaction is aborted. wh en this condition occurs, the abt bit is set in the spistat register as well as the irq b it (indicating the tran saction is complete).
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 120 the next time ss asserts, the miso pin outputs spidat[7], regardless of where the previ- ous transaction left off. writing a 1 to abt clears this error flag. spi interrupts when spi interrupts are enabled, the spi gene rates an interrupt after character transmis- sion/reception completes in both master and slave modes. a character can be defined to be 1 through 8 bits by the numbits field in the spi mode register. in slave mode it is not necessary for ss to deassert between characters to generate the interrupt. the spi in slave mode can also generate an interrupt if the ss signal deasserts prior to transfer of all the bits in a character (see description of slave abort error above). writing a 1 to the irq bit in the spi status register clears the pending spi interrupt request. the irq bit must be cleared to 0 by the interrupt service routine to genera te future interrupts. to start the transfer process, an spi interrupt may be forced by software writing a 1 to the str bit in the spictl register. if the spi is disabled, an spi interrupt can be generated by a baud rate generator time- out. this timer function must be enabled by setting the birq bit in the spictl register. this baud rate generator time-out does not se t the irq bit in the spistat register, just the spi interrupt bit in the interrupt controller. spi baud rate generator in spi master mode, the baud rate genera tor creates a lower frequency serial clock (sck) for data transmission synchronization between the master and the external slave. the input to the baud rate generator is the system clock. the spi baud rate high and low byte registers combine to form a 16-bit reload value, brg[15:0], for the spi baud rate generator. the spi baud rate is calculated using the following equation: minimum baud rate is obtained by setting brg[15:0] to 0000h for a clock divisor value of (2 x 65536 = 131072). when the spi is disabled, the baud rate generator can function as a basic 16-bit timer with interrupt on time-out. observe the foll owing procedure to configure the baud rate generator as a timer with interrupt on time-out: 1. disable the spi by clearing the spien bit in the spi control register to 0. 2. load the appropriate 16-bit count value into the spi baud rate high and low byte registers. 3. enable the baud rate generator timer fu nction and associated interrupt by setting the birq bit in the spi control register to 1. spi baud rate (bits/s) system clock frequency (hz) 2 brg[15:0] ? ------------------------------------------------------------------------ =
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 121 when configured as a general purpose timer, th e interrupt interval is calculated using the following equation: spi control register definitions this section defines the features of the foll owing serial peripheral interface registers. spi data register : see page 121 s pi control register : see page 122 s pi status register : see page 123 s pi mode register : see page 125 s pi diagnostic state register : see page 126 s pi baud rate high and low byte registers : see page 126 spi data register the spi data register, shown in table 64, stores both the outgoing (transmit) data and the incoming (receive) data. reads from the spi data register always return the current con- tents of the 8-bit shift register. data is shifte d out starting with bit 7. the last bit received resides in bit position 0. with the spi configured as a master, writing a da ta byte to this register initiates the data transmission. with the spi conf igured as a slave, writing a data byte to this register loads the shift register in preparation for the next data transfer with the external master. in either the master or slave modes, if a transmission is already in progress, writes to this register are ignored and the overrun error flag, ov r, is set in the spi status register. when the character length is less than 8 b its (as set by the numbits field in the spi mode register), the transmit character must be left justified in the spi data register. a received character of less than 8 bits is right justified (last bit received is in bit position 0). for example, if the spi is configured for 4- bit characters, the transmit characters must be written to spidata[7:4] and the received characters are read from spidata[3:0]. interrupt interval (s) syste m clock period (s) brg[15:0] ? =
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 122 spi control register the spi control register, shown in table 65 , configures the spi for transmit and receive operations. table 64. spi data register (spidata) bit 7 6 5 4 3 2 1 0 field data reset x r/w r/w address f60h bit description [7:0] ? data data transmit and/or receive data. table 65. spi control register (spictl) bit 7 6 5 4 3 2 1 0 field irqe str birq phase clkpol wor mmen spien reset 0 r/w r/w address f61h bit description [7] ? irqe interrupt request enable 0 = spi interrupts are disabled. no interrupt requests are sent to the interrupt controller. 1 = spi interrupts are enabled. interrupt requests are sent to the interrupt controller. [6] ? str start an spi interrupt request 0 = no effect. 1 = setting this bit to 1 also sets the irq bit in the spi status register to 1. setting this bit forces the spi to send an interrupt request to the interrupt control. this bit can be used by software for a function similar to transmit buffer empty in a uart. writing a 1 to the irq bit in the spi status register clears this bit to 0. [5] ? birq brg timer interrupt request if the spi is enabled, this bit has no effect. if the spi is disabled: 0 = the baud rate generator timer function is disabled. 1 = the baud rate generator timer function and time-out interrupt are enabled.
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 123 spi status register the spi status register, shown in table 66, in dicates the current state of the spi. all bits revert to their reset state if the spi en bit in the spictl register = 0. [4] ? phase phase select sets the phase relationship of the data to the clock. for more information about operation of the phase bit, see the spi clock phase and polarity control section on page 116. [3] ? clkpol clock polarity 0 = sck idles low (0). 1 = sck idle high (1). [2] ? wor wire-or (open-drain) mode enabled 0 = spi signal pins not configured for open-drain. 1 = all four spi signal pins (sck, ss , miso, mosi) configured for open-drain function. this setting is typically used for multimaste r and/or multislave configurations. [1] ? mmen spi master mode enable 0 = spi configured in slave mode. 1 = spi configured in master mode. [0] ? spien spi enable 0 = spi disabled. 1 = spi enabled. table 66. spi status register (spistat) bit 7 6 5 4 3 2 1 0 field irq ovr col abt reserved txst slas reset 01 r/w r/w* r address f62h note: r/w* = read access. write a 1 to clear the bit to 0. bit description [7] ? irq interrupt request if spien = 1, this bit is set if the str bit in t he spictl register is set, or upon completion of an spi master or slave transaction. this bit do es not set if spien = 0 and the spi baud rate generator is used as a timer to generate the spi interrupt. 0 = no spi interrupt request pending. 1 = spi interrupt request is pending. [6] ? ovr overrun 0 = an overrun error has not occurred. 1 = an overrun error has been detected. bit description (continued)
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 124 [5] ? col collision 0 = a multimaster collision (m ode fault) has not occurred. 1 = a multimaster collision (mod e fault) has been detected. [4] ? abt slave mode transaction abort this bit is set if the spi is configured in slave mode, a transaction is occurring and ss deas- serts before all bits of a character have been transferred as defined by the numbits field of the spimode register. the irq bit also sets, indicating the transaction has completed. 0 = a slave mode transaction abort has not occurred. 1 = a slave mode transaction abort has been detected. [3:2] reserved these bits are reserved and must be programmed to 00. [1] ? txst transmit status 0 = no data transmission currently in progress. 1 = data transmission cu rrently in progress. [0] ? slas slave select if spi enabled as a slave, then the following conditions are true: 0 = ss input pin is asserted (low). 1 = ss input is not a sserted (high). if spi enabled as a master, this bit is not applicable. bit description (continued)
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 125 spi mode register the spi mode register, shown in table 67, configures the character bit width and the direction and value of the ss pin. table 67. spi mode register (spimode) bit 7 6 5 4 3 2 1 0 field reserved diag num bits[2:0] ssio ssv reset 0 r/w rr / w address f63h bit description [7:6] reserved these bits are reserved and must be programmed to 00. [5] ? diag diagnostic mode control bit this bit is for spi diagnostics. setting this bi t allows the baud rate generator value to be read using the spibrh and spibrl register locations. 0 = reading spibrh, spibrl returns the va lue in the spibrh and spibrl registers. 1 = reading spibrh returns bits [15:8] of the spi baud rate generator; and reading spibrl returns bits [7:0] of the spi baud rate counter. the baud rate counter high and low byte values are not buffered. caution: exercise caution if reading the values while the brg is counting. [4] ? numbits[2:0] number of data bits per character to transfer this field contains the number of bits to sh ift for each character tr ansfer. for information about valid bit positions when the charac ter length is less than 8 bits, see the spi data register (spidata) description. 000 = 8 bits. 001 = 1 bit. 010 = 2 bits. 011 = 3 bits. 100 = 4 bits. 101 = 5 bits. 110 = 6 bits. 111 = 7 bits. [1] ? ssio slave select i/o 0 = ss pin configured as an input. 1 = ss pin configured as an output (master mode only). [0] ? ssv slave select value if ssio = 1 and spi is configured as a master, the following conditions are true: 0 = ss pin driven low (0). 1 = ss pin driven high (1). ? this bit has no effect if ssio = 0 or if spi is configured as a slave.
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 126 spi diagnostic state register the spi diagnostic state register, shown in table 68, provides obse rvability of internal state. this register is a read-only regi ster that is used for spi diagnostics. spi baud rate high an d low byte registers the spi baud rate high and low byte regist ers, shown in tables 69 and 70, combine to form a 16-bit reload value, brg[15:0], for the spi baud rate generator. when configured as a general purpose timer, th e spi brg interrupt interval is calculated using the following equation: table 68. spi diagnostic state register (spidst) bit 7 6 5 4 3 2 1 0 field scken tcken spistate reset 0 r/w r address f64h bit description [7] ? scken shift clock enable 0 = the internal shift clock enable signal is deasserted. 1 = the internal shift clock enable signal is asse rted (shift register is updates on next sys- tem clock). [6] ? tcken transmit clock enable 0 = the internal transmit clock enable signal is deasserted. 1 = the internal transmit clock enable signal is asserted. when this is asserted the serial data out is updated on the next system clock (mosi or miso). [5:0] ? spistate spi state machine defines the current state of the internal spi state machine. spi brg interrupt interval (s) s ystem clock period (s) brg[15:0] ? =
ps019924-0113 p r e l i m i n a r y spi control register definitions z8 encore! xp ? f64xx series product specification 127 table 69. spi baud rate high byte register (spibrh) bit 7 6 5 4 3 2 1 0 field brh reset 1 r/w r/w address f66h bit description [7:0] ? brh spi baud rate high byte most significant byte, brg[15:8], of the spi baud rate generator?s reload value. table 70. spi baud rate low byte register (spibrl) bit 7 6 5 4 3 2 1 0 field brl reset 1 r/w r/w address f67h bit description [7:0] ? brl spi baud rate low byte least significant byte, brg[7:0], of the spi baud rate generator?s reload value.
ps019924-0113 p r e l i m i n a r y i2c controller z8 encore! xp ? f64xx series product specification 128 i 2 c controller the i 2 c controller makes the z8 encore! xp f64 xx series products bus-compatible with the i 2 c protocol. the i 2 c controller consists of two bidirectional bus lines: a serial data signal (sda) and a serial clock signal (scl). features of the i 2 c controller include: ? transmit and receive operation in master mode ? maximum data rate of 400 kilobit/sec ? 7- and 10-bit addressing modes for slaves ? unrestricted number of data bytes transmitted per transfer ? the i 2 c controller in the z8 encore! xp f64x x series products does not operate in slave mode. architecture figure 27 displays the architecture of the i 2 c controller.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 129 operation the i 2 c controller operates in master mode to transmit and receive data. only a single master is supported. arbitration between two masters must be accomplished in software. i 2 c supports the follo wing operations: ? master transmits to a 7-bit slave ? master transmits to a 10-bit slave ? master receives from a 7-bit slave ? master receives from a 10-bit slave figure 27. i 2 c controller block diagram sda scl i 2 cctl ishift i 2 cdata i 2 cbrh i 2 cbrl shift load tx/rx state machine baud rate generator receive i 2 cstat register bus i 2 c interrupt
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 130 sda and scl signals i 2 c sends all addresses, data and acknowledge si gnals over the sda line, most significant bit first. scl is the common clock for the i 2 c controller. when the sda and scl pin alternate functions are selected for their respective gpio port s, the pins are automatically configured for open -drain operation. the master (i 2 c) is responsible for driving the scl clock signal, although the clock signal can become skewed by a slow slave device. du ring the low period of the clock, the slave pulls the scl signal low to suspend the tran saction. the master releases the clock at the end of the low period and notices that the cloc k remains low instead of returning to a high level. when the slave re leases the clock, the i 2 c controller continues the transaction. all data is transferred in bytes and there is no limit to the amount of da ta transferred in one operation. when transmitting data or acknow ledging read data from the slave, the sda signal changes in the middle of the low period of scl and is sampled in the middle of the high period of scl. i 2 c interrupts the i 2 c controller contains four sources of in terrupts?transmit, receive, not acknowl- edge and baud rate generator. these four inte rrupt sources are combined into a single interrupt request signal to the interrupt controller. the tr ansmit interrupt is enabled by the ien and txi bits of the control register. the receive and not ac knowledge interrupts are enabled by the ien bit of the control regi ster. the baud rate ge nerator interrupt is enabled by the birq and ien bits of the control register. not acknowledge interrupts oc cur when a not acknowledg e condition is received from the slave or sent by the i 2 c controller and neither the start or stop bit is set. the not acknowledge event sets the ncki bit of the i 2 c status register and can only be cleared by setting the start or stop bit in the i 2 c control register. when this interrupt occurs, the i 2 c controller waits until either the stop or star t bit is set before performing any action. in an interrupt service routine, th e ncki bit should always be checked prior to servicing transmit or receive interrupt conditions becau se it indicates the transaction is being termi- nated. receive interrupts occur when a byte of data has been r eceived by the i 2 c controller (master reading data from slave). this procedure sets the rdrf bit of the i 2 c status reg- ister. the rdrf bit is cleared by reading the i 2 c data register. the rdrf bit is set dur- ing the acknowledge phase. the i 2 c controller pauses after the acknowledge phase until the receive interrupt is cleared before performing any other action. transmit interrupts occur when the tdre bit of the i 2 c status register sets and the txi bit in the i 2 c control register is set. transmit in terrupts occur under the following condi- tions when the transmit data register is empty: ? the i 2 c controller is enabled
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 131 ? the first bit of the byte of an address is shifting out and the rd bit of the i 2 c status register is deasserted. ? the first bit of a 10-bit address shifts out ? the first bit of write data shifts out writing to the i 2 c data register always clears the trde bit to 0. when tdre is asserted, the i 2 c controller pauses at the beginning of the acknowledge cycle of the byte currently shifting out. it does not resume until the data register is written with the next value to send or until the stop or start bits are set, indicating that the current byt e is the last one to send. the fourth interrupt source is th e baud rate generator. if the i 2 c controller is disabled (ien bit in the i2cctl register = 0) and the birq bit in the i2cctl register = 1, an interrupt is generated when the baud rate gene rator counts down to 1. this allows the i 2 c baud rate generator to be used by softwa re as a general purpose timer when ien = 0. software control of i 2 c transactions software can control i 2 c transactions by using the i 2 c controller interrupt, by polling the i 2 c status register or by dma. note that not all products include a dma controller. to use interrupts, the i 2 c interrupt must be enabled in th e interrupt controller. the txi bit in the i 2 c control register must be set to enable transmit interrupts. to control transactions by polling, the interru pt bits (tdre, rdrf and ncki) in the i 2 c status register should be polled. the tdre bit asserts regardless of the state of the txi bit. either or both transmit and receive data movement can be controlled by the dma control- ler. the dma controller channel(s) mu st be initialized to select the i 2 c transmit and receive requests. transmit dma requests require that the txi bit in the i 2 c control reg- ister be set. a transmit (write) dma operation hangs if the slave responds with a not acknowledge before the last byte has been sent. after receiving the not acknowledge, the i 2 c control- ler sets the ncki bit in the status register an d pauses until either the stop or start bits in the control register are set. ? ? for a receive (read) dma transaction to send a not acknowledge on the last byte, the receive dma must be set up to receive n-1 by tes, then software must set the nak bit and receive the last (nth) byte directly. note: caution:
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 132 start and stop conditions the master (i 2 c) drives all start and stop signals an d initiates all transactions. to start a transaction, the i 2 c controller generates a start condition by pulling the sda signal low while scl is high. to comp lete a transaction, the i 2 c controller generates a stop condi- tion by creating a low-to-high transition of th e sda signal while the scl signal is high. the start and stop bits in the i 2 c control register control the sending of the start and stop conditions. a master is also a llowed to end one transaction an d begin a new one by issuing a restart. this is accomplished by setting the start bit at the end of a transaction, rather than the stop bit. note that the start condition not sent until the start bit is set and data has been written to the i 2 c data register. master write and read transactions the following sections provide a recommended procedure for performing i 2 c write and read transactions from the i 2 c controller (master) to slave i 2 c devices. in general soft- ware should rely on the tdre, rdrf and ncki bits of the status regi ster (these bits gen- erate interrupts) to initiate software actions. when using interrupts or dma, the txi bit is set to start each transaction and cleared at the end of each tran saction to eliminate a trail- ing transmit interrupt. caution should be used in using the ack stat us bit within a transa ction because it is diffi- cult for software to tell when it is updated by hardware. when writing data to a slave, the i 2 c pauses at the beginning of the acknowledge cycle if the data register has not been written with th e next value to be se nt (tdre bit in the i 2 c status register = 1). in this scenario wh ere software is not keeping up with the i 2 c bus (tdre asserted longer than one byte time), the acknowledge clock cycle for byte n is delayed until the data register is written with byte n + 1, and appears to be grouped with the data clock cycles for byte n+1. if eith er the start or stop bit is set, the i 2 c does not pause prior to the acknowledge cycle because no additional data is sent. when a not acknowledg e condition is received during a write (either during the address or data phases), the i 2 c controller generates the not ac knowledge interrupt (ncki = 1) and pause until either the stop or start bit is set. unless the not ac knowledge was received on the last byte, the data register will alre ady have been written with the next address or data byte to send. in this case the flush bit of the control regi ster should be set at the same time the stop or start bit is set to remove the stale transmit data and enable subsequent transmit interrupts. when reading data from the slave, the i 2 c pauses after the data acknowledge cycle until the receive interrupt is serviced and the rdrf bit of the status register is cleared by read- ing the i 2 c data register. once the i 2 c data register has been read, the i 2 c reads the next data byte.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 133 address only transaction with a 7-bit address in the situation where software determines if a slave with a 7-bit address is responding without sending or receiving data, a transactio n can be done which only consists of an address phase. figure 28 displays this address only transaction to determine if a slave with a 7-bit address will acknowledge. as an example, this tran saction can be used after a write has been performed to an eeprom to dete rmine when the eeprom completes its inter- nal write operation and is again responding to i 2 c transactions. if the slave does not acknowledge, the transaction can be rep eated until the slave does acknowledge. observe the following procedure for an address only transaction to a 7-bit addressed slave: 1. software asserts the ien bit in the i 2 c control register. 2. software asserts the txi bit of the i 2 c control register to enable transmit interrupts. 3. the i 2 c interrupt asserts, because the i 2 c data register is empty (tdre = 1) 4. software responds to the tdre bit by writing a 7-bit slave address plus write bit (= 0) to the i 2 c data register. as an alternative this could be a read operation instead of a write operation. 5. software sets the start and stop bits of the i 2 c control register and clears the txi bit. 6. the i 2 c controller sends the start condition to the i 2 c slave. 7. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister. 8. software polls the stop bit of the i 2 c control register. hardware deasserts the stop bit when the address only transaction is completed. 9. software checks the ack bit of the i 2 c status register. if the slave acknowledged, the ack bit is = 1. if the sl ave does not acknowledge, the ack bit is = 0. the ncki interrupt does not occur in the not acknowl edge case because the stop bit was set. write transaction with a 7-bit address figure 29 displays the data transfer format for a 7-bit addressed slave. shaded regions indicate data transferred from the i 2 c controller to slaves and unshaded regions indicate data transferred from the slaves to the i 2 c controller. s slave address w = 0 a/a p figure 28. 7-bit address only transaction format
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 134 observe the following procedure for a transmit operation to a 7-bit addressed slave: 1. software asserts the ien bit in the i 2 c control register. 2. software asserts the txi bit of the i 2 c control register to enable transmit interrupts. 3. the i 2 c interrupt asserts, because the i 2 c data register is empty 4. software responds to the td re bit by writing a 7-bit slave address plus write bit (=0) to the i 2 c data register. 5. software asserts the start bit of the i 2 c control register. 6. the i 2 c controller sends the start condition to the i 2 c slave. 7. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister. 8. after one bit of address has been shifted ou t by the sda signal, the transmit interrupt is asserted (tdre = 1). 9. software responds by writing the transmit data into the i 2 c data register. 10. the i 2 c controller shifts the rest of the ad dress and write bit out by the sda signal. 11. if the i 2 c slave sends an acknowledge (by pullin g the sda signal low) during the next high period of scl t he i 2 c controller sets the ack bit in the i 2 c status regis- ter. continue with step 12 . ? ? if the slave does not acknowledge, the not ac knowledge interrupt occurs (ncki bit is set in the status register, ack bit is clea red). software responds to the not acknowl- edge interrupt by setting the stop and flush bits and cl earing the txi bit. the i 2 c con- troller sends the stop conditio n on the bus and clears the stop and ncki bits. the transaction is complete (ignore the following steps). 12. the i 2 c controller loads the contents of the i 2 c shift register with the contents of the i 2 c data register. 13. the i 2 c controller shifts the data out of usin g the sda signal. after the first bit is sent, the transmit interrupt is asserted. 14. if more bytes remain to be sent, return to step 9 . 15. software responds by setting the stop bit of the i 2 c control register (or start bit to ini- tiate a new transaction). in the stop cas e, software clears the txi bit of the i 2 c control register at the same time. s slave address w = 0 a data a data a data a/a p/s figure 29. 7-bit addressed slave data transfer format
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 135 16. the i 2 c controller completes transmission of the data on the sda signal. 17. the slave may either acknowledge or not acknowledge the last byte. because either the stop or start bit is already set , the ncki interrupt does not occur. 18. the i 2 c controller sends the stop (o r restart) condition to the i 2 c bus. the stop or start bit is cleared. address only transaction with a 10-bit address in the situation where software wants to de termine if a slave with a 10-bit address is responding without sending or receiving data, a transaction can be done which only con- sists of an address phase. figure 30 displays this address only transaction to determine if a slave with 10-bit address will acknowledge. as an example, this transaction can be used after a write has been performed to an eeprom to determine when the eeprom com- pletes its internal write operation and is again responding to i 2 c transactions. if the slave does not acknowledge the transa ction can be repeated until th e slave is able to acknowl- edge. observe the following procedure for an addr ess only transaction to a 10-bit addressed slave: 1. software asserts the ien bit in the i 2 c control register. 2. software asserts the txi bit of the i 2 c control register to enable transmit interrupts. 3. the i 2 c interrupt asserts, because the i 2 c data register is empty (tdre = 1) 4. software responds to the td re interrupt by writing the first slave address byte. the least significant bit must be 0 for the write operation. 5. software asserts the start bit of the i 2 c control register. 6. the i 2 c controller sends the start condition to the i 2 c slave. 7. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister. 8. after one bit of address is shifted out by the sda signal, the transmit interrupt is asserted. 9. software responds by writing the second byte of address in to the contents of the i 2 c data register. s slave address 1st 7 bits w = 0 a/a slave address 2nd byte a/a p figure 30. 10-bit address only transaction format
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 136 10. the i 2 c controller shifts the rest of the first byte of address and write bit out the sda signal. 11. if the i 2 c slave sends an ac knowledge by pulling the sda signal low during the next high period of scl the i 2 c controller sets the ack bit in the i 2 c status register. continue with step 12 . ? ? if the slave does not acknowledge the first address byte, the i 2 c controller sets the ncki bit and clears the ack bit in the i 2 c status register. soft ware responds to the not acknowledge interrupt by setting the stop and flush bits and clearing the txi bit. the i 2 c controller sends the stop condition on the bus and clears the stop and ncki bits. the transaction is comp lete (ignore following steps). 12. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister (2nd byte of address). 13. the i 2 c controller shifts the second address byte out the sda signal. after the first bit has been sent, the tran smit interrupt is asserted. 14. software responds by setting the stop bit in the i 2 c control register. the txi bit can be cleared at the same time. 15. software polls the stop bit of the i 2 c control register. hardware deasserts the stop bit when the transaction is completed (stop condition has been sent). 16. software checks the ack bit of the i 2 c status register. if the slave acknowledged, the ack bit is = 1. if the sl ave does not acknowledge, the ack bit is = 0. the ncki interrupt do not occur because the stop bit was set. write transaction with a 10-bit address figure 31 displays the data transfer format for a 10-bit addressed slave. shaded regions indicate data transferred from the i 2 c controller to slaves and unshaded regions indicate data transferred from the slaves to the i 2 c controller. the first seven bits transmi tted in the first byte are 11110xx . the two bits xx are the two most significant bits of the 10-bit address. the lo west bit of the first byte transferred is the read/write control bit (=0). the transmit oper ation is carried out in the same manner as 7- bit addressing. observe the following procedure for a tran smit operation on a 10-bit addressed slave: 1. software asserts the ien bit in the i 2 c control register. s slave address 1st 7 bits w = 0 a slave address 2nd byte a data a data a/a p/s figure 31. 10-bit addressed slave data transfer format
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 137 2. software asserts the txi bit of the i 2 c control register to enable transmit interrupts. 3. the i 2 c interrupt asserts because the i 2 c data register is empty. 4. software responds to the tdre interrupt by writing the first slave address byte to the i 2 c data register. the least significant bi t must be 0 for the write operation. 5. software asserts the start bit of the i 2 c control register. 6. the i 2 c controller sends the start condition to the i 2 c slave. 7. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister. 8. after one bit of address is shifted out by the sda signal, the transmit interrupt is asserted. 9. software responds by writing the second byte of address in to the contents of the i 2 c data register. 10. the i 2 c controller shifts the rest of the first byte of address and write bit out the sda signal. 11. if the i 2 c slave acknowledges the first addres s byte by pulling the sda signal low during the next high period of scl , the i 2 c controller sets the ack bit in the i 2 c status register. continue with step 12 . ? ? if the slave does not acknowledge the first address byte, the i 2 c controller sets the ncki bit and clears the ack bit in the i 2 c status register. soft ware responds to the not acknowledge interrupt by setting the stop and flush bits and clearing the txi bit. the i 2 c controller sends the stop condition on the bus and clears the stop and ncki bits. the transaction is complete (ignore the following steps). 12. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister. 13. the i 2 c controller shifts the second address byte out the sda signal. after the first bit has been sent, the tran smit interrupt is asserted. 14. software responds by writing a data byte to the i 2 c data register. 15. the i 2 c controller completes shiftin g the contents of the shift register on the sda signal. 16. if the i 2 c slave sends an ac knowledge by pulling the sda signal low during the next high period of scl , the i 2 c controller sets the ack bit in the i 2 c status register. continue with step 17 . ? ? if the slave does not acknowledge the second ad dress byte or one of the data bytes, the i 2 c controller sets the ncki bit and clears the ack bit in the i 2 c status register. software responds to the no t acknowledge interrupt by settin g the stop and flush bits and clearing the txi bit. the i 2 c controller sends the stop condition on the bus and
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 138 clears the stop and ncki bits. the transa ction is complete (ignore the following steps). 17. the i 2 c controller shifts the data out by the sda signal. after the first bit is sent, the transmit interrupt is asserted. 18. if more bytes remain to be sent, return to step 14 . 19. if the last byte is currently being sent, software sets the stop bit of the i 2 c control register (or start bit to initiate a new transac tion). in the stop case, software also clears the txi bit of the i 2 c control register at the same time. 20. the i 2 c controller completes transmission of the last data byte on the sda signal. 21. the slave may either acknowledge or not acknowledge the last byte. because either the stop or start bit is already set , the ncki interrupt does not occur. 22. the i 2 c controller sends the stop (or restart) condition to the i 2 c bus and clears the stop (or start) bit. read transaction with a 7-bit address figure 32 displays the data transfer format fo r a read operation to a 7-bit addressed slave. the shaded regions indicate data transferred from the i 2 c controller to slaves and unshaded regions indicate data tr ansferred from the slaves to the i 2 c controller. observe the following procedure for a read operation to a 7-bit addressed slave: 1. software writes the i 2 c data register with a 7-bit slave address plus the read bit (= 1). 2. software asserts the start bit of the i 2 c control register. 3. if this is a single byte transfer, software asserts the nak bit of the i 2 c control regis- ter so that after the first byte of data has been read by the i 2 c controller, a not acknowledge is sent to the i 2 c slave. 4. the i 2 c controller sends the start condition. 5. the i 2 c controller shifts the address a nd read bit out the sda signal. 6. if the i 2 c slave acknowledges the address by pulling the sda signal low during the next high period of scl, the i 2 c controller sets the ack bit in the i 2 c status regis- ter. continue with step 7 . ? ? if the slave does not acknowledge, the not ac knowledge interrupt occurs (ncki bit is s slave address r = 1 a data adata a p/s figure 32. receive data transfer format for a 7-bit addressed slave
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 139 set in the status register, ack bit is clea red). software responds to the not acknowl- edge interrupt by setting the stop bit and clearing the txi bit. the i 2 c controller sends the stop condition on the bus and clear s the stop and ncki bits. the transaction is complete (ignore the following steps). 7. the i 2 c controller shifts in the byte of data from the i 2 c slave on the sda signal. the i 2 c controller sends a not acknowledge to the i 2 c slave if the nak bit is set (last byte), else it sends an acknowledge. 8. the i 2 c controller asserts the receive interrupt (rdrf bit set in the status register). 9. software responds by reading the i 2 c data register which clears the rdrf bit. if there is only one more byte to receive, set the nak bit of the i 2 c control register. 10. if there are more bytes to transfer, return to step 7 . 11. after the last byte is shifted in, a not acknowledge interrupt is generated by the i 2 c controller. 12. software responds by setting the stop bit of the i 2 c control register. 13. a stop condition is sent to the i 2 c slave, the stop and ncki bits are cleared. read transaction with a 10-bit address figure 33 displays the read transaction form at for a 10-bit addressed slave. the shaded regions indicate data transferred from the i 2 c controller to slaves and unshaded regions indicate data transferred from the slaves to the i 2 c controller. the first seven bits transm itted in the first byte are 11110xx . the two ( xx ) bits are the two most significant bits of the 10-bit address. the lo west bit of the first byte transferred is the write control bit. observe the following procedure for the data transfer for a read operation to a 10-bit addressed slave: 1. software writes 11110b followed by the two address bits and a 0 (write) to the i 2 c data register. 2. software asserts the start and txi bits of the i 2 c control register. 3. the i 2 c controller sends the start condition. 4. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister. s slave address 1st 7 bits w=0 a slave address 2nd byte a s slave address 1st 7 bits r=1 a data adata a p figure 33. receive data format for a 10-bit addressed slave
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 140 5. after the first bit has been shifted out, a transmit interrupt is asserted. 6. software responds by writing the lower eight bits of address to the i 2 c data register. 7. the i 2 c controller completes shifting of th e two address bits and a 0 (write). 8. if the i 2 c slave acknowledges the first addres s byte by pulling the sda signal low during the next high period of scl , the i 2 c controller sets the ack bit in the i 2 c status register. continue with step 9 . ? ? if the slave does not acknowledge the first address byte, the i 2 c controller sets the ncki bit and clears the ack bit in the i 2 c status register. soft ware responds to the not acknowledge interrupt by setting the stop and flush bits and clearing the txi bit. the i 2 c controller sends the stop condition on the bus and clears the stop and ncki bits. the transaction is comp lete (ignore following steps). 9. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister (second address byte). 10. the i 2 c controller shifts out the second address by te. after the first bit is shifted, the i 2 c controller generates a transmit interrupt. 11. software responds by setting the start bit of the i 2 c control register to generate a repeated start by clearing the txi bit. 12. software responds by writing 11110b followed by the 2-bit slave address and a 1 (read) to the i 2 c data register. 13. if only one byte is to be read , software sets the nak bit of the i 2 c control register. 14. after the i 2 c controller shifts out the 2nd address byte, the i 2 c slave sends an acknowledge by pulling the sda signal low during the next high period of scl , the i 2 c controller sets the ack bit in the i 2 c status register. continue with step 15 . ? ? if the slave does not acknowledge the second address byte, the i 2 c controller sets the ncki bit and clears the ack bit in the i 2 c status register. soft ware responds to the not acknowledge interrupt by setting the stop and flush bits and clearing the txi bit. the i 2 c controller sends the stop condition on the bus and clears the stop and ncki bits. the transaction is complete (ignore the following steps). 15. the i 2 c controller sends the repeated start condition. 16. the i 2 c controller loads the i 2 c shift register with the contents of the i 2 c data reg- ister (third address transfer). 17. the i 2 c controller sends 11110b followed by the two most significant bits of the slave read address and a 1 (read). 18. the i 2 c slave sends an acknowledge by pulling the sda signal low during the next high period of scl ? ?
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 141 if the slave were to not acknowledge at this point (this should not happen because the slave did acknowledge the firs t two address bytes), softwa re would respond by setting the stop and flush bits and clearing the txi bit. the i 2 c controller sends the stop con- dition on the bus and clears the stop and ncki bits. th e transaction is complete (ignore the following steps). 19. the i 2 c controller shifts in a byte of data from the i 2 c slave on the sda signal. the i 2 c controller sends a not acknowledge to the i 2 c slave if the nak bit is set (last byte), else it sends an acknowledge. 20. the i 2 c controller asserts the receive interrupt (rdrf bit set in the status register). 21. software responds by reading the i 2 c data register which clears the rdrf bit. if there is only one more byte to receive, set the nak bit of the i 2 c control register. 22. if there are one or more bytes to transfer, return to step 19 . 23. after the last byte is shifted in, a not acknowledge interrupt is generated by the i 2 c controller. 24. software responds by setting the stop bit of the i 2 c control register. 25. a stop condition is sent to the i 2 c slave and the stop and ncki bits are cleared. i 2 c control register definitions this section defines the features of the following i 2 c control registers. i 2 c data register : see page 141 i 2 c status register : see page 142 i 2 c control register : see page 144 i 2 c baud rate high an d low byte registers : see page 145 i 2 c diagnostic state register : see page 147 i 2 c diagnostic control register : see page 149 i 2 c data register the i 2 c data register, shown in table 71, holds th e data that is to be loaded into the i 2 c shift register during a write to a slave. this re gister also holds data that is loaded from the i 2 c shift register during a read from a slave. the i 2 c shift register is not accessible in the register file address space, but is used only to buffer incoming and outgoing data.
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 142 i 2 c status register the read-only i 2 c status register, shown in table 72, indicates the status of the i 2 c con- troller. table 71. i 2 c data register (i2cdata) bit 7 6 5 4 3 2 1 0 field data reset 0 r/w r/w address f50h table 72. i 2 c status register (i2cstat) bit 7 6 5 4 3 2 1 0 field tdre rdrf ack 10b rd tas dss ncki reset 10 r/w r address f51h bit description [7] ? tdre transmit data register empty when the i 2 c controller is enabled, this bit is 1 when the i 2 c data register is empty. when this bit is set, an interrupt is generated if the txi bit is set, except when the i 2 c controller is shifting in data during the reception of a byte or when shifting an address and the rd bit is set. this bit is cleared by writing to the i2cdata register. [6] ? rdrf receive data register full this bit is set = 1 when the i 2 c controller is enabled and the i 2 c controller has received a byte of data. when asserted, this bit causes the i 2 c controller to generate an interrupt. this bit is cleared by reading the i 2 c data register (unless the read is performed using execution of the on-chip debugger?s read register command).
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 143 [5] ? ack acknowledge this bit indicates the status of the acknowledge for the last byte transm itted or received. when set, this bit indicates that an acknowledge occu rred for the last byte transmitted or received. this bit is cleared when ien = 0 or when a no t acknowledge occurred fo r the last byte trans- mitted or received. it is not reset at the beginnin g of each transaction and is not reset when this register is read. caution: when making decisions based on this bit wi thin a transaction, so ftware cannot deter- mine when the bit is updated by hardware. in the case of write transactions, the i 2 c pauses at the beginning of the acknowledge cycle if the next transmit data or address byte has not been written (tdre = 1) and stop and start = 0. in this case the ack bit is not updated until the transmit interrupt is serviced and the acknowl edge cycle for the previous byte completes. for examples of how the ack bit can be used, see the address only transaction with a 7-bit address section on page 133 and the address only transaction with a 10-bit address section on page 135. [4] ? 10b 10-bit address this bit indicates whether a 10- or 7-bit address is being transmitted. after the start bit is set, if the five most significant bits of the address are 11110b , this bit is set. when set, it is reset once the first byte of the address has been sent. [3] ? rd read this bit indicates the direction of transfer of the data. it is active high during a read. the status of this bit is determined by the least significant bit of the i 2 c shift register after the start bit is set. [2] ? tas transmit address state this bit is active high while the a ddress is being shifted out of the i 2 c shift register. [1] ? dss data shift state this bit is active high while data is being shifted to or from the i 2 c shift register. [0] ? ncki nack interrupt this bit is set high when a not acknowledge condit ion is received or sent and neither the start nor the stop bit is active. when set, this bit g enerates an interrupt that can only be cleared by setting the start or stop bit, allowing you to specify whether to perform a stop or a repeated start. bit description (continued)
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 144 i 2 c control register the i 2 c control register, shown in table 73, enables i 2 c operation. table 73. i 2 c control register (i2cctl) bit 7 6 5 4 3 2 1 0 field ien start stop birq txi nak flush filten reset 0 r/w r/w r/w1 r/w1 r/w r/w r/w1 w1 r/w address f52h bit description [7] ? ien i 2 c enable 1 = the i 2 c transmitter and receiver are enabled. 0 = the i 2 c transmitter and receiver are disabled. [6] ? start send start condition this bit sends the start condition. on ce asserted, it is cleared by the i 2 c controller after it sends the start condition or if the ien bit is deasserted. if this bit is 1, it cannot be cleared to 0 by writing to the register. after this bit is set, the start condition is sent if there is data in the i 2 c data register or i 2 c shift register. if there is no data in one of these registers, the i 2 c controller waits until the data register is written. if this bit is set while the i 2 c controller is shifting out data, it generates a start condition after the byte shifts and the acknowledge phase completes. if the stop bit is also set, it also waits until the stop condition is sent before the sending the start condition. [5] ? stop send stop condition this bit causes the i 2 c controller to issue a stop condition after the byte in the i 2 c shift regis- ter has completed transmission or after a byte ha s been received in a receive operation. after it is set, this bit is reset by the i 2 c controller after a stop condition has been sent or by deas- serting the ien bit. if this bit is 1, it cannot be cleared to 0 by writing to the register. [4] ? birq baud rate generator interrupt request this bit allows the i 2 c controller to be used as an additional timer when the i 2 c controller is disabled. this bit is ignored when the i 2 c controller is enabled. 1 = an interrupt occurs every time the baud rate generator counts down to one. 0 = no baud rate generator interrupt occurs. [3] ? txi enable tdre interrupts this bit enables the transmit interrupt when the i 2 c data register is empty (tdre = 1). 1 = transmit interrupt (and dma transmit request) is enabled. 0 = transmit interrupt (and dma transmit request) is disabled. [2] ? nak send nak this bit sends a not acknowledge condition after the next byte of data has been read from the i 2 c slave. once asserted, it is deasserted after a not acknowledge is sent or the ien bit is deasserted. if this bit is 1, it cannot be cleared to 0 by writing to the register.
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 145 i 2 c baud rate high and low byte registers the i 2 c baud rate high and low byte registers, shown in tables 74 and 75, combine to form a 16-bit reload valu e, brg[15:0], for the i 2 c baud rate generator. when the i 2 c is disabled, the baud rate generato r can function as a basic 16-bit timer with interrupt on time-out. to configure the ba ud rate generator as a timer with interrupt on time-out, complete the following procedure: 1. disable the i 2 c by clearing the ien bit in the i 2 c control register to 0. 2. load the appropriate 16-b it count value into the i 2 c baud rate high and low byte registers. 3. enable the baud rate generator timer fu nction and associated interrupt by setting the birq bit in the i 2 c control register to 1. ? when configured as a general purpose timer, th e interrupt interval is calculated using the following equation: [1] ? flush flush data setting this bit to 1 clears the i 2 c data register and sets the tdre bit to 1. this bit allows flushing of the i 2 c data register when a not acknowledge interrupt is received after the data has been sent to the i 2 c data register. reading this bit always returns 0. [0] ? filten i 2 c signal filter enable this bit enables low-pass digital filters on the sda and scl input signals. these filters reject any input pulse with periods less than a full syst em clock cycle. the filters introduce a 3-sys- tem clock cycle latency on the inputs. 1 = low-pass filters are enabled. 0 = low-pass filters are disabled. bit description (continued) interrupt interval (s) system clock period (s) brg 15:0 ?? ? =
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 146 table 74. i 2 c baud rate high byte register (i2cbrh) bit 7 6 5 4 3 2 1 0 field brh reset ffh r/w r/w address f53h bit description [7:0] ? brh i 2 c baud rate high byte most significant byte, brg[15:8], of the i 2 c baud rate generator?s reload value. note: if the diag bit in the i 2 c diagnostic control register is set to 1, a read of the i2cbrh register returns the current value of the i 2 c baud rate counter[15:8]. table 75. i 2 c baud rate low byte register (i2cbrl) bit 7 6 5 4 3 2 1 0 field brl reset ffh r/w r/w address f54h bit description [7:0] ? brl i 2 c baud rate low byte least significant byte, brg[7:0], of the i 2 c baud rate generator?s reload value. note: if the diag bit in the i 2 c diagnostic control register is set to 1, a read of the i2cbrl register returns the current value of the i 2 c baud rate counter[7:0].
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 147 i 2 c diagnostic state register the i 2 c diagnostic state register, shown in ta ble 76, provides obse rvability into the internal state. this register is read-only; it is used for i 2 c diagnostics and manufacturing test purposes. table 76. i 2 c diagnostic state register (i2cdst) bit 7 6 5 4 3 2 1 0 field sclin sdain stpcnt txrxstate reset x0 r/w r address f55h bit description [7] ? sclin serial clock input value of the serial clock input signal. [6] ? sdain serial data input value of the serial data input signal. [5] ? stpcnt stop count value of the internal stop count control signal.
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 148 [4:0] ? txrxstate internal state value of the internal i 2 c state machine. txrxstate state description 0_0000 0_0001 0_0010 0_0011 0_0100 0_0101 0_0110 0_0111 0_1000 0_1001 0_1010 0_1011 0_1100 0_1101 0_1110 ? 0_1111 ? 1_0000 1_0001 1_0010 1_0011 1_0100 1_0101 1_0110 1_0111 1_1000 1_1001 ? 1_1010 ? 1_1011 ? 1_1100 ? 1_1101 ? 1_1110 ? 1_1111 ? idle state. start state. send/receive data bit 7. send/receive data bit 6. send/receive data bit 5. send/receive data bit 4. send/receive data bit 3. send/receive data bit 2. send/receive data bit 1. send/receive data bit 0. data acknowledge state. second half of data acknowledge state used only for not acknowledge. first part of stop state. second part of stop state. 10-bit addressing: acknowledge state for 2nd address byte ? 7-bit addressing: address acknowledge state. 10-bit address: bit 0 (least signi ficant bit) of 2nd address byte ? 7-bit address: bit 0 (least significant bit) (r/w) of address byte. 10-bit addressing: bit 7 (most sign ificant bit) of 1st address byte. 10-bit addressing: bit 6 of 1st address byte. 10-bit addressing: bit 5 of 1st address byte. 10-bit addressing: bit 4 of 1st address byte. 10-bit addressing: bit 3 of 1st address byte. 10-bit addressing: bit 2 of 1st address byte. 10-bit addressing: bit 1 of 1st address byte. 10-bit addressing: bit 0 (r/w) of 1st address byte. 10-bit addressing: acknowledge state for 1st address byte. 10-bit addressing: bit 7 of 2nd address byte ? 7-bit addressing: bit 7 of address byte. 10-bit addressing: bit 6 of 2nd address byte ? 7-bit addressing: bit 6 of address byte. 10-bit addressing: bit 5 of 2nd address byte ? 7-bit addressing: bit 5 of address byte. 10-bit addressing: bit 4 of 2nd address byte ? 7-bit addressing: bit 4 of address byte. 10-bit addressing: bit 3 of 2nd address byte ? 7-bit addressing: bit 3 of address byte. 10-bit addressing: bit 2 of 2nd address byte ? 7-bit addressing: bit 2 of address byte. 10-bit addressing: bit 1 of 2nd address byte ? 7-bit addressing: bit 1 of address byte. [4:0] ? txrxstate (continued) bit description (continued)
ps019924-0113 p r e l i m i n a r y i2c control register definitions z8 encore! xp ? f64xx series product specification 149 i 2 c diagnostic control register the i 2 c diagnostic register, shown in table 77, provides control over diagnostic modes. this register is a read/write register that is used for i 2 c diagnostics purposes. table 77. i 2 c diagnostic control register (i2cdiag) bit 7 6 5 4 3 2 1 0 field reserved diag reset 0 r/w rr/w address f56h bit description [7:1] reserved these bits are reserved and must be programmed to 0000000. [0] ? diag diagnostic control bit selects read back value of the baud rate reload registers. 0 = normal mode. reading the baud rate high and low byte registers returns the baud rate reload value. 1 = diagnostic mode. reading the baud rate high and low byte registers returns the baud rate counter value.
ps019924-0113 p r e l i m i n a r y direct memory access controller z8 encore! xp ? f64xx series product specification 150 direct memory access controller the z8 encore! xp f64xx series direct memory access (dma) controller provides three independent direct memory access ch annels. two of the channels, dma0 and dma1, transfer data between the on-chip pe ripherals and the register file. the third channel, dma_adc, controls the adc ope ration and transfers single-shot mode adc output data to the register file. operation dma0 and dma1, referred to collectively as dma x , transfer data either from the on-chip peripheral control registers to the register f ile, or from the register file to the on-chip peripheral control regi sters. the sequence of operations in a dma x data transfer is: 1. dma x trigger source requests a dma data transfer. 2. dma x requests control of the system bus (address and data) from the ez8 cpu. 3. after the ez8 cpu acknowled ges the bus request, dma x transfers either a single byte or a two-byte word (depending upon config uration) and then returns system bus con- trol to the ez8 cpu. 4. if the current address equals the end addres s, then the following conditions are true: ? dma x reloads the original start address ? if configured to generate an interrupt, dma x sends an interrupt request to the interrupt controller ? if configured for single-pass operation, dma x resets the den bit in the dma x control register to 0 and the dma is disabled ? if the current address does not equal the end addre ss, then the current address increments by 1 (single-byte transf er) or 2 (two-byte word transfer). configuring dma0 and dma1 for data transfer observe the following procedure to co nfigure and enable dma0 or dma1: 1. write to the dma x i/o address register to set the register file address identifying the on-chip peripheral control register. the upper nibble of the 12-bit address for on- chip peripheral control registers is always fh . the full address is {fh, dma x _io[7:0]}.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 151 2. determine the 12-bit start and end register file addresses. the 12-bit start address is provided by {dma x _h[3:0], dma_start[7:0]}. the 12-bit end address is pro- vided by {dma x _h[7:4], dma_end[7:0]}. 3. write the start and end register f ile address high nibbles to the dma x end/start address high nibble register. 4. write the lower byte of the start address to the dma x start/current address register. 5. write the lower byte of the end address to the dma x end address register. 6. write to the dma x control register to comple te the following operations: ? select loop or single-pass mode operation ? select the data transfer direction (eithe r from the register file ram to the on- chip peripheral control register; or from the on-chip peripheral control register to the register file ram) ? enable the dma x interrupt request, if appropriate ? select word or byte mode ? select the dma x request trigger ? enable the dma x channel dma_adc operation dma_adc transfers data from the adc to the register file. the sequence of operations in a dma_adc data transfer is: 1. adc completes conversion on the current adc input channel and signals the dma controller that two-bytes of ad c data are ready for transfer. 2. dma_adc requests control of the system bus (address and data) from the ez8 cpu. 3. after the ez8 cpu acknowledges the bus request, dma_adc transfers the two-byte adc output value to the register file and th en returns system bus control back to the ez8 cpu. 4. if the current adc analog input is the highest-numbered input to be converted: ? the dma_adc resets the adc analog input numb er to 0 and initiates data con- version on adc analog input 0 ? if configured to generate an interrupt, the dma_adc sends an interrupt request to the interrupt controller ? if the current adc analog input is not the h i gh est-numbered input to be converted, then the dma_adc in itiates data conversion in th e next higher-numbered adc analog input.
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 152 configuring dma_ad c for data transfer observe the following procedure to configure and enable the dma_adc: 1. write the dma_adc address register with the 7 most significant bits of the register file address for data transfers. 2. write to the dma_adc control register to complete the following operations: ? enable the dma_adc interrupt request, if appropriate ? select the number of adc analog inputs to convert ? enable the dma_adc channel ? when using the dma_adc to perform conv ersions on multiple adc inputs, the ana- log-to-digital converter must be config ured for single-shot mode. if the adc_in field in the dma_adc control register is greater than 000b , the adc must be in sin- gle-shot mode. ? ? continuous mode operation of the adc can only be used in conjunction with the dma_adc if the adc_in field in the dm a_adc control register is reset to 000b to enable conversion on adc analog input 0 only. dma control register definitions this section defines the features of the following dma control registers. d ma x control register : see page 153 d ma x i/o address register : see page 154 d ma x address high nibble register : see page 155 d ma x start/current address low byte register : see page 156 d ma x end address low byte register : see page 156 d ma_adc address register : see page 157 d ma_adc control register : see page 158 d ma _adc s tatus register : see page 159 caution:
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 153 dma x control register the dma x control register, shown in table 78, enables and selects the mode of opera- tion for dma x . table 78. dma x control register (dma x ctl) bit 7 6 5 4 3 2 1 0 field den dle ddir irqen wsel rss reset 0 r/w r/w address fb0h, fb8h bit description [7] ? den dma x enable 0 = dma x is disabled and data transfer requests are disregarded. 1 = dma x is enabled and initiates a data transfer upon receipt of a request from the trigger source. [6] ? dle dma x loop enable 0 = dma x reloads the original start address and is then disabled after the end address data is transferred. 1 = dma x , after the end address data is transferred, reloads the original start address and continues operating. [5] ? ddir dma x data transfer direction 0 = register file on-chip peripheral control register. 1 = on-chip peripheral control register file. [4] ? irqen dma x interrupt enable 0 = dma x does not generate any interrupts. 1 = dma x generates an interrupt when the end address data is transferred.
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 154 dma x i/o address register the dma x i/o address register, shown in table 79, contains the low byte of the on-chip peripheral address for data transfer. the full 12-bit register file address is provided by {fh, dma x _io[7:0]}. when the dma is configured for two-byte word transfers, the dma x i/o address register must co ntain an even-numbered address. [3] ? wsel word select 0 = dma x transfers a single byte per request. 1 = dma x transfers a two-byte word per request. the address for the on-chip peripheral con- trol register must be an even address. [2:0] ? rss request trigger source select the request trigger source select field determ ines the peripheral t hat can initiate a dma transfer. the corresponding interrupts do not need to be enabled within the interrupt controller to initiate a dma transfer. howe ver, if the request trigger source can enable or disable the interrupt request sent to the interrupt controller, the interrupt request must be enabled within the request trigger source block. 000 = timer 0. 001 = timer 1. 010 = timer 2. 011 = timer 3. 100 = dma0 control register: uart0 received data register contains valid data. dma1 control register: uart0 transmit data register empty. 101 = dma0 control register: uart1 received data register contains valid data. dma1 control register: uart1 transmit data register empty. 110 = dma0 control register: i 2 c receiver interrupt. dm a1 control register: i 2 c transmitter interrupt register empty. 111 = reserved. table 79. dma x i/o address register (dma x io) bit 7 6 5 4 3 2 1 0 field dma_io reset x r/w r/w address fb1h, fb9h bit description [7:0] ? dma_io dma on-chip peripheral control register address this byte sets the low byte of the on-chip peri pheral control register address on register file page fh (addresses f00h to fffh). bit description (continued)
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 155 dma x address high nibble register the dma x address high register, shown in tabl e 80, specifies the upper four bits of address for the start/current and end addresses of dma x . table 80. dma x address high nibble register (dma x h) bit 7 6 5 4 3 2 1 0 field dma_end_h dma_start_h reset x r/w r/w address fb2h, fbah bit description [7:4] ? dma_end_h dma x end address high nibble these bits, used with the dma x end address low register, form a 12-bit end address. the full 12-bit address is provided by {dma_end_h[3:0], dma_end[7:0]}. [3:0] ? dma_start_h dma x start/current address high nibble these bits, used with the dma x start/current address low register, form a 12-bit start/ current address. the full 12-bit address is provided by {dma_start_h[3:0], dma_start[7:0]}.
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 156 dma x start/current addre ss low byte register the dma x start/current address low byte register , shown in table 81, in conjunction with the dma x address high nibble register, shown in table 80, forms a 12-bit start/ current address. writes to this register set the start address for dma operations. each time the dma completes a data transfer, the 12 -bit start/current address increments by either 1 (single-byte transfer) or 2 (two-byte wo rd transfer). reads from this register return the low byte of the current address to be used for the next dma data transfer. dma x end address low byte register the dma x end address low byte register, show n in table 82, forms a 12-bit end address. table 81. dma x start/current address low byte register (dma x start) bit 7 6 5 4 3 2 1 0 field dma_start reset x r/w r/w address fb3h, fbbh bit description [7:0] ? dma_start dma x start/current address low these bits, with the four lower bits of the dma x _h register, form the 12-bit start/current address. the full 12-bit address is provid ed by {dma_start_h[3 :0], dma_start[7:0]}. table 82. dma x end address low byte register (dma x end) bit 7 6 5 4 3 2 1 0 field dma_end reset x r/w r/w address fb4h, fbch bit description [7] ? dma_end dma x end address low these bits, with the four upper bits of the dma x _h register, form a 12-bit address. this address is the ending location of the dma x transfer. the full 12-bit address is provided by {dma_end_h[3:0], dma_end[7:0]}.
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 157 dma_adc address register the dma_adc address register, shown in table 84, points to a block of the register file to store the adc conversion values displayed in table 83 . this register contains the seven most significant bits of the 12-bit register file addresses. the five least significant bits are calculated from the adc analog input number (5-bit base address is equal to twice the adc analog input number). the 10-bit adc conversion data is stored as two bytes with the most significant byte of the adc data stored at the even-numbered register file address. table 83 provides an example of the regi ster file addresses if the dma_adc address register contains the value 72h . table 83. dma_adc register file address example adc analog input register file address (hex)* 0 720h?721h 1 722h?723h 2 724h?725h 3 726h?727h 4 728h?729h 5 72ah?72bh 6 72ch?72dh 7 72eh?72fh 8 730h?731h 9 732h?733h 10 734h?735h 11 736h?737h note: *dmaa_addr is set to 72h.
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 158 dma_adc control register the dma_adc control register, shown in table 85, enables and sets options (dma enable and interrupt en able) for adc operation. table 84. dma_adc addre ss register (dmaa_addr) bit 7 6 5 4 3 2 1 0 field dmaa_addr reserved reset x r/w r/w address fbdh bit description [7:1] ? dmaa_addr dma_adc address these bits specify the seven most significant bits of the 12-bit register file addresses used for storing the adc output data. the adc analog input number defines the five least significant bits of the register file address. full 12-bit address is {dmaa_addr[7:1], 4-bit adc analog input number, 0}. 0 reserved this bit is reserved and must be programmed to 0. table 85. dma_adc control register (dmaactl) bit 7 6 5 4 3 2 1 0 field daen irqen reserved adc_in reset 0 r/w r/w address fbeh bit description [7] ? daen dma_adc enable 0 = dma_adc is disabled and the adc anal og input number (adc_ in) is reset to 0. 1 = dma_adc is enabled. [6] ? irqen interrupt enable 0 = dma_adc does not generate any interrupts. 1 = dma_adc generates an interrupt after transferring data from the last adc analog input specified by the adc_in field.
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 159 dma_adc status register the dma status register, shown in table 86 , indicates the dma channel that generated the interrupt and the adc analog input that is currently undergoing conversion. reads from this register reset the interrupt request indicator bits (irqa, irq1, and irq0) to 0. therefore, software interrupt service routines that read this register must process all three interrupt sources from the dma. [5:4] reserved these bits are reserved and must be programmed to 00. [3:0] ? adc_in adc analog input number these bits set the number of adc analog inputs to be used in the continuous update (data conversion followed by dma data transfer). th e conversion always begins with adc analog input 0 and then progresses sequentially through the other selected adc analog inputs. 0000 = adc analog input 0 updated. 0001 = adc analog inputs 0?1 updated. 0010 = adc analog inputs 0?2 updated. 0011 = adc analog inputs 0?3 updated. 0100 = adc analog inputs 0?4 updated. 0101 = adc analog inputs 0?5 updated. 0110 = adc analog inputs 0?6 updated. 0111 = adc analog inputs 0?7 updated. 1000 = adc analog inputs 0?8 updated. 1001 = adc analog inputs 0?9 updated. 1010 = adc analog inputs 0?10 updated. 1011 = adc analog inputs 0?11 updated. 1100?1111 = reserved. table 86. dma_adc status register (dmaa_stat) bit 7 6 5 4 3 2 1 0 field cadc[3:0] reserved irqa irq1 irq0 reset 0 r/w r address fbfh bit description [7:4] ? cadc[3:0] current adc analog input this field identifies the analog input that the adc is currently converting. [3] reserved this bit is reserved and must be programmed to 0. bit description (continued)
ps019924-0113 p r e l i m i n a r y dma control register definitions z8 encore! xp ? f64xx series product specification 160 [2] ? irqa dma_adc interrupt request indicator this bit is automatically reset to 0 each time a read from this register occurs. 0 = dma_adc is not the source of t he interrupt from the dma controller. 1 = dma_adc completed transfer of data from the last adc analog input and generated an interrupt. [1] ? irq1 dma1 interrupt request indicator this bit is automatically reset to 0 each time a read from this register occurs. 0 = dma1 is not the source of the interrupt from the dma controller. 1 = dma1 completed transfer of data to/from the end address and generated an interrupt. [0] ? irq0 dma0 interrupt request indicator this bit is automatically reset to 0 each time a read from this register occurs. 0 = dma0 is not the source of the interrupt from the dma controller. 1 = dma0 completed transfer of data to/from the end address and generated an interrupt. bit description (continued)
ps019924-0113 p r e l i m i n a r y analog-to-digital converter z8 encore! xp ? f64xx series product specification 161 analog-to-digital converter the analog-to-digital converter (adc) converts an analog input signal to a 10-bit binary number. the features of the sigma-delta adc include: ? 12 analog input sources are multiple xed with general-purpose i/o ports ? interrupt upon completion of conversion ? internal voltage re ference generator ? a direct memory access (dma) controller that can automatically initiate data conver- sion and transfer the data from 1 to 12 analog inputs architecture figure 34 displays the three major functional blocks (conver ter, analog multiplexer, and voltage reference generator) of the adc. the adc converts an analog input signal to its digital representation. the 12-input analog multiplexer selects one of the 12 analog input sources. the adc requires an input reference voltage for the conversion. the voltage ref- erence for the conversion may be input through the external v ref pin or generated inter- nally by the voltage reference generator.
ps019924-0113 p r e l i m i n a r y architecture z8 encore! xp ? f64xx series product specification 162 the sigma-delta adc architecture provides al ias and image attenuation below the ampli- tude resolution of the adc in the frequency range of dc to one-half the adc clock rate (one-fourth the system clock rate). the ad c provides alias free conversion for frequen- cies up to one-half the adc clock rate. ther efore, the sigma-delta adc exhibits high noise immunity, which makes it ideal for embe dded applications. in addition, monotonic- ity (no missing codes) is guaranteed by design. figure 34. analog-to-digital converter block diagram analog-to-digital converter ana0 ana1 ana2 ana3 ana4 ana5 ana6 ana7 ana8 ana9 ana10 ana11 analog input multiplexer anain[3:0] internal voltage reference generator v ref analog input reference input
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 163 operation this section describes the opera tional aspects of the adc?s power-down and conversion features. automatic power-down if the adc is idle (i.e., no conversions are in progress) for 160 co nsecutive system clock cycles, portions of the adc are automatica lly powered down. from this powered-down state, the adc requires 40 system clock cycl es to power up. the adc powers up when a conversion is requested using the adc control register. single-shot conversion when configured for single-shot conversion, the adc performs a single analog-to-digital conversion on the selected analog input chan nel. after completion of the conversion, the adc shuts down. observe the following proc edure for setting up the adc and initiating a single-shot conversion: 1. enable the appropriate analog inputs by co nfiguring the general-purpose i/o pins for alternate function. this configuration disa bles the digital input and output drivers. 2. write to the adc control register to co nfigure the adc and begin the conversion. the bit fields in the adc control re gister can be written simultaneously: ? write to the anain[3:0] field to select one of the 12 analog input sources ? clear cont to 0 to select a single-shot conversion ? write to the vref bit to enable or disable the in ternal voltage re ference generator ? set cen to 1 to start the conversion ? 3. cen remains 1 while the conversion is in progress. a single-shot conversion requires 5129 system clock cycles to complete. if a single-shot conversion is requested from an adc powered-down state, the adc uses 40 additional clock cycles to power up before beginning the 5129 cycle conversion. 4. when the conversion is co mplete, the adc control logi c performs the following oper- ations: ? 10-bit data result written to {adcd_h[7:0], adcd_l[7:6]} ? cen resets to 0 to indicate the conversion is complete ? an interrupt request is sent to the interrupt controller ? 5. if the adc remains idle for 160 consecutive system clock cycles, it is automatically powered down.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 164 continuous conversion when configured for continuous conversion , the adc continuously performs an analog- to-digital conversion on the sel ected analog input. each new data value over-writes the previous value stored in the adc data register s. an interrupt is generated after each con- version. in continuous mode, you must be aware that adc updates are limited by the input signal bandwidth of the adc and the latency of the adc and its digital filter. step chang- es at the input are not seen at the next output from the adc. the response of the adc (in all modes) is limited by the inpu t signal bandwidth and the latency. observe the following procedure for setting up the adc and initia ting continuous conver- sion: 1. enable the appropriate analog input by configuring the general-purpose i/o pins for alternate function. this disables th e digital input and output driver. 2. write to the adc control register to co nfigure the adc for continuous conversion. the bit fields in the adc control re gister may be written simultaneously: ? write to the anain[3:0] field to select one of the 12 analog input sources ? set cont to 1 to select continuous conversion ? write to the vref bit to enable or disable the in ternal voltage re ference generator ? set cen to 1 to start the conversions ? 3. when the first conversion in continuous operation is complete (after 5129 system clock cycles, plus the 40 cycles required to power up, if necessary), the adc control logic performs the fo llowing operations: ? cen resets to 0 to indicate the first conversion is complete. cen remains 0 for all subsequent conversions in continuous operation ? an interrupt request is sent to the interrupt controller to indicate the conversion is complete ? 4. thereafter, the adc writes a new 10-bit data result to {adcd_h[7:0], adcd_l[7:6]} every 256 system clock cycles. an interrupt request is sent to the interrupt controller when e ach conversion is complete. 5. to disable continuous conversion, clear th e cont bit in the adc control register to 0. caution:
ps019924-0113 p r e l i m i n a r y adc control register definitions z8 encore! xp ? f64xx series product specification 165 dma control of the adc the direct memory access (d ma) controller can control ope ration of the adc includ- ing analog input selection and conversion en able. for more inform ation about the dma and configuring for adc operations, see the direct memory access controller chapter on page 150. adc control register definitions this section defines the features of the following adc control registers. adc control register : see page 165 a dc data high byte register : see page 167 a dc data low bits register : see page 168 adc control register the adc control register selects the analog input channel and initia tes the analog-to-dig- ital conversion. table 87. adc control register (adcctl) bit 7 6 5 4 3 2 1 0 field cen reserved vref cont anain[3:0] reset 01 0 r/w r/w address f70h bit description [7] ? cen conversion enable 0 = conversion is complete. writing a 0 produces no effect. the adc automatically clears this bit to 0 when a conversion has been completed. 1 = begin conversion. writing a 1 to this bit star ts a conversion. if a conversion is already in progress, the conversion restarts. this bit remains 1 until the conversion is complete. [6] reserved this bit is reserved and must be programmed to 0. [5] ? vref voltage reference 0 = internal voltage reference generator enabled. the v ref pin should be left unconnected (or capacitively coupled to analog ground) if the internal voltage reference is selected as the adc reference voltage. 1 = internal voltage reference generator disabled. an external voltage reference must be provided through the v ref pin.
ps019924-0113 p r e l i m i n a r y adc control register definitions z8 encore! xp ? f64xx series product specification 166 [4] ? cont conversion 0 = single-shot conversion. adc data is output once at completion of the 5129 system clock cycles. 1 = continuous conversion. adc data updated every 256 system clock cycles. [3:0] ? anain[3:0] analog input select these bits select the analog input for conversi on. for information about the port pins avail- able with each package style, see the signal and pin descriptions chapter on page 7. do not enable unavailable analog inputs. 0000 = ana0. ? 0001 = ana1. ? 0010 = ana2. ? 0011 = ana3. ? 0100 = ana4. ? 0101 = ana5. ? 0110 = ana6. ? 0111 = ana7. ? 1000 = ana8. ? 1001 = ana9. ? 1010 = ana10. ? 1011 = ana11. ? 11xx = reserved. bit description (continued)
ps019924-0113 p r e l i m i n a r y adc control register definitions z8 encore! xp ? f64xx series product specification 167 adc data high byte register the adc data high byte register, shown in ta ble 88, contains the upper eight bits of the 10-bit adc output. during a single-shot conver sion, this value is invalid. access to the adc data high byte register is read-only. the full 10-bit adc result is provided by {adcd_h[7:0], adcd_l[7:6]}. reading the adc data high byte register latches data in the adc low bits register. table 88. adc data high byte register (adcd_h) bit 7 6 5 4 3 2 1 0 field adcd_h reset x r/w r address f72h bit description [7:0] ? adcd_h adc data high byte this byte contains the upper eight bits of the 10-bit adc output. these bits are not valid during a single-shot conversion. during a continuous conv ersion, the last conversi on output is held in this register. these bits are undefined after a reset.
ps019924-0113 p r e l i m i n a r y adc control register definitions z8 encore! xp ? f64xx series product specification 168 adc data low bits register the adc data low bits register, table 89, cont ains the lower two bits of the conversion value. the data in the adc data low bits register is latched ea ch time the adc data high byte register is read. reading this regi ster always returns the lower two bits of the conversion last read into the adc high byte register. access to the adc data low bits register is read-only. the full 10-bit adc result is provided by {adcd_h[7:0], adcd_l[7:6]}. table 89. adc data low bits register (adcd_l) bit 7 6 5 4 3 2 1 0 field adcd_l reserved reset x r/w r address f73h bit description [7:6] ? adcd_l adc data low bits these are the least significant two bits of the 10-bit adc output. these bits are undefined after a reset. [5:0] reserved these bits are reserved and are always undefined.
ps019924-0113 p r e l i m i n a r y flash memory z8 encore! xp ? f64xx series product specification 169 flash memory the products in the z8 encore! xp f64xx seri es feature up to 64 kb (65,536 bytes) of non-volatile flash memory with read/write/erase capability. the flash memory can be programmed and erased in-circuit by either user code or through the on-chip debugger. the flash memory array is arranged in 512 byte per page. the 512 byte page is the mini- mum flash block size that can be erased. the flash memory is also divided into 8 sectors which can be protected from programming and erase operations on a per sector basis. table 90 describes the flash memory configuration for each device in the z8 encore! xp f64xx series. table 91 lists the sector addr ess ranges. figure 35 displays the flash mem- ory arrangement. table 90. flash memory configurations part number flash size number of pages flash memory addresses sector size number of sectors pages per sector z8f162x 16k (16,384) 32 0000h?3fffh 2k (2048) 8 4 z8f242x 24k (24,576) 48 0000h?5fffh 4k (4096) 6 8 z8f322x 32k (32,768) 64 0000h?7fffh 4k (4096) 8 8 z8f482x 48k (49,152) 96 0000h?bfffh 8k (8192) 6 16 z8f642x 64k (65,536) 128 0000h?ffffh 8k (8192) 8 16 table 91. flash memory sector addresses sector number flash sector address ranges z8f162x z8f242x z8f322x z8f482x z8f642x 0 0000h?07ffh 0000h?0fffh 0000h?0fffh 0000h?1fffh 0000h?1fffh 1 0800h?0fffh 1000h?1fffh 1000h?1fffh 2000h?3fffh 2000h?3fffh 2 1000h?17ffh 2000h?2fffh 2000h?2fffh 4000h?5fffh 4000h?5fffh 3 1800h?1fffh 3000h?3fffh 3000h?3fffh 6000h?7fffh 6000h?7fffh 4 2000h?27ffh 4000h?4fffh 4000h?4fffh 8000h?9fffh 8000h?9fffh 5 2800h?2fffh 5000h?5fffh 5000h?5fffh a000h?bfffh a000h?bfffh 6 3000h?37ffh n/a 6000h?6fffh n/a c000h?dfffh 7 3800h?3fffh n/a 7000h?7fffh n/a e000h?ffffh
ps019924-0113 p r e l i m i n a r y information area z8 encore! xp ? f64xx series product specification 170 information area table 92 describes the z8 encore! xp f64x x series information area. this 512-byte information area is accessed by se tting bit 7 of the page select register to 1. when access is enabled, the information area is mapped in to flash memory and overlays the 512 bytes at addresses fe00h to ffffh . when the information area a ccess is enabled, ldc instruc- tions return data from the information area. cpu instruction fetches always comes from flash memory regardless of the information area access bit. access to the information area is read-only. figure 35. flash memory arrangement 64kb flash program memory 0000h 128 pages 512 bytes per page 01ffh 0200h 03ffh fc00h fdffh fe00h ffffh 0400h 05ffh fa00h fbffh addresses
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 171 operation the flash controller provides the proper si gnals and timing for th e byte programming, page erase, and mass erase operations with in flash memory. the flash controller con- tains a protection mechanism, via the flash control register (fctl), to prevent acciden- tal programming or erasure. the following subsections provide details about the lock, unlock, sector protect, byte programming, page erase and mass erase operations. timing using the flash frequency registers before performing a program or erase operati on in flash memory, you must first configure the flash frequency high and low byte regi sters. the flash frequency registers allow programming and erasure of the flash with system clock frequencies ranging from 20 khz through 20 mhz (the valid range is lim ited to the device operating frequencies). the flash frequency high and low byte re gisters combine to form a 16-bit value, ffreq, to control timing for flash progra m and erase operations. the 16-bit flash fre- quency value must contain the system clock frequency in khz. this value is calculated using the following equation:. flash programming and erasure are not supp orted for system clock frequencies below 20 khz, above 20 mhz, or outside of the devices? operating frequency range. the flash frequency high and low byte registers must be loaded with the correct value to ensure proper flash programming and erase operations. table 92. z8 encore! xp f64xx series information area map flash memory address (hex) function fe00h?fe3fh reserved fe40h?fe53h part number ? 20-character ascii alphanumeric code ? left-justified and filled with zeros fe54h?ffffh reserved ffreq[15:0] system clock frequency (hz) 1000 ------------------------------------------------------------------------ = caution:
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 172 flash read protection the user code contained within flash memory can be protected from external access. pro- gramming the flash read protect option bit prev ents reading of user code by the on-chip debugger or by using the flash controller by pass mode. for more information, see the option bits chapter on page 180 and the on-chip debugger chapter on page 183. flash write/erase protection the z8 encore! xp f64xx series provides seve ral levels of protection against accidental program and erasure of the flash memory cont ents. this protection is provided by the flash controller unlock mechanis m, the flash sector protect register, and the flash write protect option bit. flash controller unlock mechanism at reset, the flash controller locks to prev ent accidental program or erasure of flash memory. to program or erase flash memory, th e flash controller must be unlocked. after unlocking the flash controller, the flash can be programmed or erased. any value written by user code to the flash control register or page select register out of sequence will lock the flash controller. observe the following procedure to unlo ck the flash controller from user code: 1. write 00h to the flash control register to reset the flash controller. 2. write the page to be programmed or erased to the page select register. 3. write the first unlock command 73h to the flash control register. 4. write the second unlock command 8ch to the flash control register. 5. rewrite the page written in step 2 to the page select register. flash sector protection the flash sector protect register can be co nfigured to prevent sectors from being pro- grammed or erased. after a sector is protected, it cannot be unprotected by user code. the flash sector protect register is cleared af ter reset and any previously written protection values is lost. user co de must write this register in thei r initialization routine if they want to enable sector protection. the flash sector protect register shares its register file address with the page select register. the flash sector protect register is accessed by writing the flash control regis- ter with 5eh . after the flash sector protect register is selected, it can be accessed at the page select register address. when user co de writes the flash sector protect register, bits can only be set to 1. thus, sectors can be protected, but not unprotected, via register write operations. writing a value other than 5eh to the flash control register deselects the flash sector protect register and reen ables access to the page select register.
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 173 observe the following procedure to setup th e flash sector protect register from user code: 1. write 00h to the flash control register to reset the flash controller. 2. write 5eh to the flash control register to select the flash sector protect register. 3. read and/or write the flash sector protect register which is now at register file address ff9h . 4. write 00h to the flash control register to return the flash controller to its reset state. flash write protection option bit the flash write protect option bit can be en abled to block all program and erase opera- tions from user code. for mo re information, see the option bits chapter on page 180. byte programming when the flash controller is unlocked, writes to flash memory from user code will pro- gram a byte into the flash if the address is located in the unlocked page. an erased flash byte contains all ones ( ffh ). the programming operation can only be used to change bits from one to zero. to change a flash bit (or mu ltiple bits) from zero to one requires a page erase or mass erase operation. byte programming can be accomplished using the ez8 cpu?s ldc or ldci instructions. for a description of the ldc and ld ci instructions, refer to the ez8 cpu core user man- ual (um0128) , which is available for download on www.zilog.com. while the flash controller programs flash memory, the ez8 cpu idles but the system clock and on-chip peripherals continue to op erate. interrupts that occur when a program- ming operation is in progress are serviced af ter the programming oper ation is complete. to exit programming mode and lock the flash controller, write 00h to the flash control register. user code cannot program flash memory on a page that resides in a protected sector. when user code writes memory locations, only addresses located in the unlocked page are programmed. memory writes outside of the unlocked page are ignored. each memory location must not be programmed more than twice before an erase occurs. observe the following procedure to program the flash from user code: 1. write 00h to the flash control register to reset the flash controller. 2. write the page of memory to be pr ogrammed to the page select register. 3. write the first unlock command 73h to the flash control register. caution:
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 174 4. write the second unlock command 8ch to the flash control register. 5. rewrite the page written in step 2 to the page select register. 6. write flash memory using ldc or ldci instructions to program the flash. 7. repeat step 6 to program additional memory locations on the same page. 8. write 00h to the flash control register to lock the flash controller. page erase flash memory can be erased on e page (512 bytes) at a time. page-erasing flash memory sets all bytes in a page to the value ffh . the page select register identifies the page to be erased. while the flash controller executes th e page erase operation, the ez8 cpu idles; however, the system clock and on-chip peri pherals continue to operate. the ez8 cpu resumes operation after the page erase opera tion completes. interrupts that occur when the page erase operation is in progress are serviced after the page erase operation is com- plete. when the page erase operation is co mplete, the flash controller returns to its locked state. only pages located in unprotected sectors can be erased. observe the following procedure to perform a page erase operation: 1. write 00h to the flash control register to reset the flash controller. 2. write the page to be erased to the page select register. 3. write the first unlock command 73h to the flash control register. 4. write the second unlock command 8ch to the flash control register. 5. rewrite the page written in step 2 to the page select register. 6. write the page erase command 95h to the flash control register. mass erase the flash memory cannot be mass-erased by user code. flash controller bypass the flash controller can be bypassed and th e control signals for flash memory can be brought out to the gpio pins. bypassing the flash controller allows faster programming algorithms by controlling the flash programming signals directly. flash controller bypass is recommended for gang programming applications and large volume customers who do not require in -circuit programming of flash memory.
ps019924-0113 p r e l i m i n a r y flash control register definitions z8 encore! xp ? f64xx series product specification 175 for more information about bypassing the flash controller, refer to the third party flash programming support for z8 en core! mcus application not e (an0117) , which is avail- able for download at www.zilog.com . flash controller behavior in debug mode the following changes in flash controller behavior occur when the flash controller is accessed using the on-chip debugger: ? the flash write protect option bit is ignored ? the flash sector protect register is ignored for programming and erase operations ? programming operations are not limited to the page selected in the page select register ? bits in the flash sector protect register can be written to one or zero ? the second write of the page select register to unlock the flash controller is not nec- essary ? the page select register can be writte n when the flash controller is unlocked ? the mass erase command is enabled through the flash control register ? for security reasons, the flash controller allo ws only a single page to be opened for write/erase operations. when writing multiple flash pages, th e flash controller must go through the unlock sequence again to select another page. flash control register definitions this section defines the features of the following flash control registers. flash control register : see page 175 f lash status register : see page 177 p age select register : see page 177 f lash sector protect register : see page 178 f lash frequency high and low byte registers : see page 179 flash control register the flash control register, shown in table 93, unlocks the flash controller for program- ming and erase operations, or to select the flash sector protect register. caution:
ps019924-0113 p r e l i m i n a r y flash control register definitions z8 encore! xp ? f64xx series product specification 176 the write-only flash control register shares its register file address with the read-only flash status register. table 93. flash control register (fctl) bit 7 6 5 4 3 2 1 0 field fcmd reset 0 r/w w address ff8h bit description [7:0] ? fcmd flash command* 73h = first unlock command. 8ch = second unlock command. 95h = page erase command. 63h = mass erase command 5eh = flash sector protect register select. note: *all other commands, or any command out of sequence, lock the flash controller.
ps019924-0113 p r e l i m i n a r y flash control register definitions z8 encore! xp ? f64xx series product specification 177 flash status register the flash status register, shown in table 94, indicates the current state of the flash con- troller. this register can be read at any time. the read-only flash status register shares its register file address with the write-only flash control register. page select register the page select (fps) register, shown in tabl e 95, selects one of th e 128 available flash memory pages to be erased or programmed. each flash page contains 512 bytes of flash memory. during a page erase operation, all fl ash memory locations with the 7 most sig- nificant bits of the address provided by the page field are erased to ffh . the page select register shares its register file address with the flash sector protect register. the page select register cannot be accessed when the flash sector protect reg- ister is enabled. table 94. flash status register (fstat) bit 7 6 5 4 3 2 1 0 field reserved fstat reset 0 r/w r address ff8h bit description [7:6] reserved these bits are reserved and must be programmed to 00. [5:0] ? fstat flash controller status 00_0000 = flash controller locked. 00_0001 = first unlock command received. 00_0010 = second unlock command received. 00_0011 = flash controller unlocked. 00_0100 = flash sector pr otect register selected. 00_1xxx = program operation in progress. 01_0xxx = page erase operation in progress. 10_0xxx = mass erase operation in progress.
ps019924-0113 p r e l i m i n a r y flash control register definitions z8 encore! xp ? f64xx series product specification 178 flash sector protect register the flash sector protect register, shown in table 96, protects flash memory sectors from being programmed or erased from user code. the flash sector protect register shares its register file address with the page select re gister. the flash sector protect register can be accessed only after writing th e flash control register with 5eh . user code can only write bits in this register to 1 (bits cannot be cleared to 0 by user code). to determine the appropriate flash memory sector address range and sector number for your z8f64xx series product, please refer to table 91 on page 169. table 95. page select register (fps) bit 7 6 5 4 3 2 1 0 field info_en page reset 0 r/w r/w address ff9h bit description [7] ? info_en information area enable 0 = information area is not selected. 1 = information area is selected. the information area is mapped into the flash memory address space at addresses fe00h through ffffh. [6:0] ? page page select this 7-bit field selects the flash memory page for programming and page erase operations. flash memory address[15:9] = page[6:0]. table 96. flash sector protect register (fprot) bit 7 6 5 4 3 2 1 0 field sect7 sect6 sect5 sect4 sect3 sect2 sect1 sect0 reset 0 r/w r/w* address ff9h note: *r/w = this register is accessible for read operations; it can be written to 1 only via user code. bit description [7:0] ? sect n sector protect** 0 = sector n can be programmed or erased from user code. 1 = sector n is protected and cannot be programmed or erased from user code. note: **user code can only write bits from 0 to 1.
ps019924-0113 p r e l i m i n a r y flash control register definitions z8 encore! xp ? f64xx series product specification 179 flash frequency high and low byte registers the flash frequency high and low byte regi sters, shown in tables 97 and 98, combine to form a 16-bit value, ffreq, to control ti ming for flash program and erase operations. the 16-bit flash frequency registers must be written with the system clock frequency in khz for program and erase operations. calcul ate the flash frequency value using the fol- lowing equation: flash programming and erasure is not supp orted for system clock frequencies below 20 khz, above 20 mhz, or outside of the va lid operating frequency range for the device. the flash frequency high and low byte regist ers must be loaded with the correct value to ensure proper program and erase times. table 97. flash frequency high byte register (ffreqh) bit 7 6 5 4 3 2 1 0 field ffreqh reset 0 r/w r/w address ffah table 98. flash frequency low byte register (ffreql) bit 7 6 5 4 3 2 1 0 field ffreql reset 0 r/w r/w address ffbh bit description [7:0] ? ffreqh, ffreql flash frequency high and low bytes these 2 bytes, {ffreqh[7:0], ffreql[7:0]}, contain the 16-bit flash frequency value. ffreq[15:0] ffreqh[7:0],ffreql[7:0] ?? system clock frequency 1000 ----------------------------------------------------------- - == caution:
ps019924-0113 p r e l i m i n a r y option bits z8 encore! xp ? f64xx series product specification 180 option bits option bits allow user configuration of certai n aspects of the z8 en core! xp f64xx series operation. the feature configuration data is stored in the flash memory and read during reset. the features available for control via the option bits are: ? watchdog timer time-out response selection?interrupt or reset ? watchdog timer enabled at reset ? the ability to prevent unwa nted read access to user code in flash memory ? the ability to prevent accident al programming and erasure of the user code in flash memory ? voltage brown-out configuration is always enabled or disabled during stop mode to reduce stop mode power consumption ? oscillator mode selection for high-, medium -, and low-power crystal oscillators or an external rc oscillator operation this section describes the type and configur ation of the programmable flash option bits. option bit configuration by reset each time the option bits are programmed or erased, the device must be reset for the change to take place. during any reset operation (system reset, reset, or stop mode recovery), the option bits ar e automatically read from the flash memory and written to option configuration registers. the option co nfiguration registers control operation of the devices within the z8 en core! xp f64xx series. option bit control is established before the device exits reset and the ez8 cp u begins code execution. the option config- uration registers are not part of the register file and are not accessible for read or write access. option bit address space the first two bytes of flash memory at addresses 0000h (see table 99) and 0001h (see table 100) are reserved for the user option bits. the byte at flash memory address 0000h configures user options. the by te at flash memory address 0001h is reserved for future use and must remain unprogrammed.
ps019924-0113 p r e l i m i n a r y option bit address space z8 encore! xp ? f64xx series product specification 181 flash memory address 0000h table 99. flash option bits at flash memory address 0000h bit 7 6 5 4 3 2 1 0 field wdt_res wdt_ao osc_sel[1:0] vbo_ao rp reserved fwp reset u r/w r/w address program memory 0000h note: u = unchanged by reset; r/w = read/write. bit description [7] ? wdt_res watchdog timer reset 0 = watchdog timer time-out generates an inte rrupt request. in terrupts must be globally enabled for the ez8 cpu to acknowledge the interrupt request. 1 = watchdog timer time-out causes a short reset. this setting is the default for unpro- grammed (erased) flash. [6] ? wdt_ao watchdog timer always on 0 = watchdog timer is automatically enabled upon application of system power. watch- dog timer can not be disabled except during stop mode (if configured to power down during stop mode). 1 = watchdog timer is enabled upon executio n of the wdt instruction. once enabled, the watchdog timer can only be disabled by a reset or stop mode recovery. this setting is the default for unprogrammed (erased) flash. [5:4] ? osc_sel[1:0] oscillator mode selection 00 = on-chip oscillator configured fo r use with external rc networks ( < 4 mhz). 01 = minimum power for use with very low frequency crystals (32 khz to 1.0 mhz). 10 = medium power for use with medium frequency crystals or ceramic resonators (0.5 mhz to 10.0 mhz). 11 = maximum power for use with high freque ncy crystals (8.0 mhz to 20.0 mhz). this setting is the default for unprogrammed (erased) flash. [3] ? vbo_ao voltage brown-out protection always on 0 = voltage brown-out protection is disabled in stop mode to reduce total power con- sumption. 1 = voltage brown-out protection is always enabled including during stop mode. this setting is the default for unprogrammed (erased) flash. [2] ? rp read protect 0 = user program code is inaccessible. limited control features are available through the on-chip debugger. 1 = user program code is accessible. all on-chip debugger commands are enabled. this setting is the default for unprogrammed (erased) flash.
ps019924-0113 p r e l i m i n a r y option bit address space z8 encore! xp ? f64xx series product specification 182 flash memory address 0001h [1] reserved this bit is reserved and must be programmed to 0. [0] ? fwp flash write protect (flash version only) 0 = programming, page erase, and mass erase through user code is disabled. mass erase is available through the on-chip debugger. 1 = programming, and page erase are enabled for all of flash program memory. table 100. options bits at flash memory address 0001h bit 7 6 5 4 3 2 1 0 field reserved reset u r/w r/w address program memory 0001h note: u = unchanged by reset. r/w = read/write. bit description [7:0] reserved these option bits are reserved for future use and must always be 1. this setting is the default for unprogrammed (erased) flash. bit description (continued)
ps019924-0113 p r e l i m i n a r y on-chip debugger z8 encore! xp ? f64xx series product specification 183 on-chip debugger the z8 encore! xp f64xx series products contain an integrated on-chip debugger (ocd) that provides advanced debugging features including: ? reading and writing of the register file ? reading and writing of program and data memory ? setting of breakpoints ? execution of ez8 cpu instructions architecture the on-chip debugger consists of four primary functional blocks: transmitter, receiver, autobaud generator, and debug controller. fi gure 36 displays the architecture of the on- chip debugger. figure 36. on-chip debugger block diagram autobaud detector/generator transmitter receiver debug controller system clock dbg pin ez8 tm cpu control
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 184 operation the following section describ es the operation of the ocd. ocd interface the on-chip debugger uses the dbg pin for communication with an external host. this one-pin interface is a bidirec tional open-drain interface that transmits and receives data. data transmission is half-duplex, meaning that transmit and receive operations cannot occur simultaneously. the serial data on the dbg pin is sent using the standard asynchro- nous data format defined in rs-232. this pin can interface the z8 encore! xp f64xx series products to the serial port of a host pc using minimal external hardware.two differ- ent methods for connecting the db g pin to an rs-232 interface are depicted in figures 37 and 38. for proper operation of the on-chip debugger, all power pins (v dd and av dd ) must be supplied with power, and all ground pins (v ss and av ss ) must be properly grounded. the dbg pin is open-drain and must always be connected to v dd through an external pull-up resistor to ensure proper operation. figure 37. interfacing the on-chip debugger?s dbg pin with an rs-232 interface, #1 of 2 caution: rs-232 tx rs-232 rx rs-232 transceiver v dd dbg pin 10k ? diode
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 185 debug mode the operating characteristics of the z8 encore! xp f64xx series devices in debug mode are: ? the ez8 cpu fetch unit stops, idling the ez8 cpu, unless directed by the ocd to ex- ecute specific instructions ? the system clock operates unless in stop mode ? all enabled on-chip peripherals operate unless in stop mode ? automatically exits halt mode ? constantly refreshes the wa tchdog timer, if enabled entering debug mode the device enters debug mode followi ng any of the following operations: ? writing the dbgmode bit in the ocd contro l register to 1 using the ocd interface ? ez8 cpu execution of a breakpoint (brk) instruction (when enabled) ? if the dbg pin is low when the device exits reset, the on-chip debugger automati- cally puts the device into debug mode exiting debug mode the device exits debug mode followin g any of the following operations: ? clearing the dbgmode bit in th e ocd control register to 0 ? power-on reset figure 38. interfacing the on-chip debugger?s dbg pin with an rs-232 interface, #2 of 2 rs-232 tx rs-232 rx rs-232 transceiver v dd dbg pin 10k ? open-drain buffer
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 186 ? voltage brown-out reset ? asserting the reset pin low to initiate a reset ? driving the dbg pin low while the device is in stop mode initia tes a system reset ocd data format the ocd interface uses the asynchronous data format defined for rs-232. each character is transmitted as 1 start bit, 8 data bits (least significant bit first), and 1 stop bit, as shown in figure 39. ocd autobaud detector/generator to run over a range of baud rates (bits per second) with various system clock frequencies, the on-chip debugger has an autobaud detector /generator. after a reset, the ocd is idle until it receives data. the ocd requires that th e first character sent from the host is the character 80h . the character 80h has eight continuous bits low (one start bit plus 7 data bits). the autobaud detector measures this period and sets the ocd baud rate generator accordingly. the autobaud detector/generator is clocked by the system clock. the minimum baud rate is the system clock frequency divided by 51 2. for optimal operation, the maximum rec- ommended baud rate is the system clock fre quency divided by 8. the theoretical maxi- mum baud rate is the system clock frequency divided by 4. this theoretical maximum is possible for low noise designs with clean signals. table 101 lists minimum and recom- mended maximum baud rates fo r sample crystal frequencies. figure 39. ocd data format table 101. ocd baud-rate limits system clock frequency (mhz) recommended maximum baud rate (kbits/s) minimum baud rate (kbits/s) 20.0 2500 39.1 1.0 125.0 1.96 0.032768 (32 khz) 4.096 0.064 startd0d1d2d3d4d5d6d7stop
ps019924-0113 p r e l i m i n a r y operation z8 encore! xp ? f64xx series product specification 187 if the ocd receives a serial break (nine or more continuous bits low) the autobaud detector/generator resets. the autobaud detector/generator can then be reconfigured by sending 80h . ocd serial errors the on-chip debugger can detect any of the following error conditions on the dbg pin: ? serial break (a minimum of nine continuous bits low) ? framing error (received stop bit is low) ? transmit collision (ocd and host simultane ous transmission detected by the ocd) ? when the ocd detects one of these errors, it aborts any command currently in progress, transmits a serial break 4096 system clock cycles long back to the host, and resets the autobaud detector/generator. a framing error or transmit co llision may be caused by the host sending a serial break to the ocd. because of the open-drain natu re of the interface, returning a serial break back to the host only extends the length of the serial break if the host releases the serial break early. the host transmits a serial break on the dbg pin when first connectin g to the z8 encore! xp f64xx series devices or when recovering from an error. a serial break from the host resets the autobaud generator/detector but does not reset the ocd control register. a serial break leaves the device in debug mode if that is the current mode. the ocd is held in reset until the end of the serial break when the dbg pin retu rns high. because of the open-drain nature of the dbg pin, the host can send a serial break to the ocd even if the ocd is transmitting a character. breakpoints execution breakpoints are generated using the brk instruction (op code 00h ). when the ez8 cpu decodes a brk instruction, it signal s the on-chip debugger. if breakpoints are enabled, the ocd idles the ez8 cpu and enters debug mode. if breakpoints are not enabled, the ocd ignores the brk signal an d the brk instruction operates as an nop. if breakpoints are enabled, the ocd can be configured to automa tically enter debug mode, or to loop on the break instruction. if the ocd is configured to loop on the brk instruction, then th e cpu is still enabled to servic e dma and interrupt requests. the loop on brk instruction can be used to service interrupts in the background. for interrupts to be serviced in the background, there cannot be any breakpoints in the inter- rupt service routine. otherwise, the cpu stops on the breakpoint in the interrupt routine. for interrupts to be serviced in the background, interrupts mu st also be enabled. debug- ging software should not automatically enable interrupts when using this feature, since
ps019924-0113 p r e l i m i n a r y on-chip debugger commands z8 encore! xp ? f64xx series product specification 188 interrupts are typically disabled during criti cal sections of code where interrupts should not occur (such as adjusting the stack pointer or modifying shared data). software can poll the idle bit of the ocdstat register to determine if the ocd is loop- ing on a brk instruction. when software stop s the cpu on the brk instruction that it is looping on, it should not set the dbgmode bit of the ocdctl register. the cpu may have vectored to and be in the middle of an interrupt service routine when this bit gets set. instead, software must clear the brklp bit. th is action allows the cpu to finish the inter- rupt service routine it may be in and return the brk instruc tion. when the cpu returns to the brk instruction it was prev iously looping on, it automa tically sets the dbgmode bit and enters debug mode. software detects that the majority of the ocd commands are still disabled when the ez8 cpu is looping on a brk instruction. the ez8 cpu must be stopped and the part must be in debug mode before the se commands can be issued. breakpoints in flash memory the brk instruction is op code 00h , which corresponds to the fully programmed state of a byte in flash memory. to implement a breakpoint, write 00h to the appropriate address, overwriting the current instruction. to remo ve a breakpoint, the corresponding page of flash memory must be erased and re programmed with the original data. on-chip debugger commands the host communicates to the on-chip debugger by sending ocd commands using the dbg interface. during normal operation, on ly a subset of the ocd commands are avail- able. in debug mode, all ocd commands be come available unless the user code and control registers are protected by programmin g the read protect option bit (rp). the read protect option bit prevents the code in memory from being read out of the z8 encore! xp f64xx series products. when this option is enabled, several of the ocd commands are disabled. table 102 contains a summary of the on-chip debugger commands. table 102 lists those commands that operate when the device is not in debug mode (normal operation) and those commands that are disabled by pr ogramming the read protect option bit. each ocd command is furt her described in the list that follows the table.
ps019924-0113 p r e l i m i n a r y on-chip debugger commands z8 encore! xp ? f64xx series product specification 189 in the following list of ocd commands, data and commands sent from the host to the on- chip debugger are identified by dbg command/data . data sent from the on-chip debugger back to the host is identified by dbg data . read ocd revision (00h). the read ocd revision comman d determines the version of the on-chip debugger. if ocd commands are adde d, removed, or changed, this revision number changes. table 102. on-chip debugger commands debug command command byte enabled when not in debug mode? disabled by read protect option bit read ocd revision 00h yes ? read ocd status register 02h yes ? read runtime counter 03h ? ? write ocd control register 04h yes cannot clear dbgmode bit read ocd control register 05h yes ? write program counter 06h ? disabled read program counter 07h ? disabled write register 08h ? only writes of the flash memory control registers are allowed. additionally, only the mass erase command is allowed to be written to the flash control register. read register 09h ? disabled write program memory 0ah ? disabled read program memory 0bh ? disabled write data memory 0ch ? disabled read data memory 0dh ? disabled read program memory crc 0eh ? ? reserved 0fh ? ? step instruction 10h ? disabled stuff instruction 11h ? disabled execute instruction 12h ? disabled reserved 13h?ffh ? ?
ps019924-0113 p r e l i m i n a r y on-chip debugger commands z8 encore! xp ? f64xx series product specification 190 dbg 00h? dbg ocdrev[15:8] (major revision number) ? dbg ocdrev[7:0] (minor revision number) read ocd status register (02h). the read ocd status register command reads the ocdstat register. dbg 02h? dbg ocdstat[7:0] write ocd control register (04h). the write ocd control register command writes the data that follows to the ocdctl regist er. when the read protect option bit is enabled, the dbgmode bit (ocd ctl[7]) can only be set to 1, it cannot be cleared to 0 and the only method of putting th e device back into normal op erating mode is to reset the device. dbg 04h? dbg ocdctl[7:0] read ocd control register (05h). the read ocd control regi ster command reads the value of the ocdctl register. dbg 05h? dbg ocdctl[7:0] write program counter (06h). the write program counter command writes the data that follows to the ez8 cpu?s program coun ter (pc). if the device is not in debug mode or if the read protect option bit is enabled, the program counter (pc) values are discarded. dbg 06h? dbg programcounter[15:8] ? dbg programcounter[7:0] read program counter (07h). the read program counter co mmand reads the value in the ez8 cpu?s program counter (pc). if the devi ce is not in debug mode or if the read protect option bit is enable d, this command returns ffffh . dbg 07h? dbg programcounter[15:8] ? dbg programcounter[7:0] write register (08h). the write register command writes data to the register file. data can be written 1-256 bytes at a time (256 by tes can be written by setting size to zero). if the device is not in debug mode, the address and data values are discarded. if the read protect option bit is enabled, then only writ es to the flash control registers are allowed and all other register write data values are discarded. dbg 08h? dbg {4?h0,register address[11:8]} ? dbg register address[7:0] ?
ps019924-0113 p r e l i m i n a r y on-chip debugger commands z8 encore! xp ? f64xx series product specification 191 dbg size[7:0] ? dbg 1-256 data bytes read register (09h). the read register command reads data from the register file. data can be read 1-256 bytes at a time (256 byt es can be read by setting size to zero). if the device is not in debug mode or if the read protect option bit is enabled, this command returns ffh for all the data values. dbg 09h? dbg {4?h0,register address[11:8] ? dbg register address[7:0] ? dbg size[7:0] ? dbg 1-256 data bytes write program me mory (0ah). the write program memory command writes data to program memory. this command is equivalent to the ldc and ldci instructions. data can be written 1-65536 bytes at a time (65536 bytes can be written by setting size to zero). the on-chip flash controller must be written to and unlocked for the programming opera- tion to occur. if the flash controller is not unlo cked, the data is discarded. if the device is not in debug mode or if the read protect opt ion bit is enabled, th e data is discarded. dbg 0ah? dbg program memory address[15:8] ? dbg program memory address[7:0] ? dbg size[15:8] ? dbg size[7:0] ? dbg 1-65536 data bytes read program memory (0bh). the read program memory command reads data from program memory. this command is equivalent to the ldc and ldci instructions. data can be read 1-65536 bytes at a time (65536 bytes can be read by setting si ze to zero). if the device is not in debug mode or if the read protect option bit is enabled, this command returns ffh for the data. dbg 0bh? dbg program memory address[15:8] ? dbg program memory address[7:0] ? dbg size[15:8] ? dbg size[7:0] ? dbg 1-65536 data bytes write data memory (0ch). the write data memory comman d writes data to data mem- ory. this command is equivalent to the lde and ldei instructions. data can be written 1- 65536 bytes at a time (65536 bytes can be written by setting size to zero). if the device is not in debug mode or if the read protect opt ion bit is enabled, th e data is discarded. dbg 0ch? dbg data memory address[15:8] ? dbg data memory address[7:0] ? dbg size[15:8] ? dbg size[7:0] ? dbg 1-65536 data bytes
ps019924-0113 p r e l i m i n a r y on-chip debugger commands z8 encore! xp ? f64xx series product specification 192 read data memory (0dh). the read data memory comm and reads from data memory. this command is equivalent to the lde and ldei instructions . data can be read 1-65536 bytes at a time (65536 bytes can be read by setting size to zero). if the device is not in debug mode, this command returns ffh for the data. dbg 0dh? dbg data memory address[15:8] ? dbg data memory address[7:0] ? dbg size[15:8] ? dbg size[7:0] ? dbg 1-65536 data bytes read program memory crc (0eh). the read program me mory crc command com- putes and returns the crc (cyclic redundancy ch eck) of program memo ry using the 16-bit crc-ccitt polynomial. if the device is no t in debug mode, this command returns ffffh for the crc value. unlike most other oc d read commands, there is a delay from issuing of the command until the ocd return s the data. the ocd reads program memory, calculates the crc value, and returns the resu lt. the delay is a function of the program memory size and is approximately equal to th e system clock period multiplied by the num- ber of bytes in program memory. dbg 0eh? dbg crc[15:8] ? dbg crc[7:0] step instruction (10h). the step instruction command st eps one assembly instruction at the current program counter (p c) location. if the device is not in debug mode or the read protect option bit is enabled, the ocd ignores this command. dbg 10h stuff instruction (11h). the stuff instruction command steps one assembly instruction and allows specification of the first byte of the instruction. the rema ining 0-4 bytes of the instruction are read from program memory. th is command is useful for stepping over instructions where the first byte of the instru ction has been overwritten by a breakpoint. if the device is not in debug mo de or the read protect option bit is enabled, the ocd ignores this command. dbg 11h? dbg opcode[7:0] execute instruction (12h). the execute instruction command allows sending an entire instruction to be executed to the ez8 cpu. th is command can also st ep over breakpoints. the number of bytes to send for the instruction depends on the op code. if the device is not in debug mode or the read protect option bit is enabled, the ocd ignores this com- mand dbg 12h? dbg 1-5 byte opcode
ps019924-0113 p r e l i m i n a r y on-chip debugger control register z8 encore! xp ? f64xx series product specification 193 on-chip debugger control register definitions this section describes the features of the on -chip debugger control and status registers. ocd control register the ocd control register, shown in table 103, controls the state of the on-chip debug- ger. this register enters or exits deb ug mode and enables the brk instruction. a reset and stop function can be achieved by writing 81h to this register. a reset and go function can be achieved by writing 41h to this register. if the device is operating in debug mode, a run function can be implemented by writing 40h to this register. table 103. ocd contro l register (ocdctl) bit 7 6 5 4 3 2 1 0 field dbgmode brken dbgack brkloop reserved rst reset 0 r/w r/w r r/w bit description [7] ? dbgmode debug mode setting this bit to 1 causes the device to enter debug mode. when in debug mode, the ez8 cpu stops fetching new instructions. clearin g this bit causes the ez8 cpu to start run- ning again. this bit is automatically set when a brk instruction is decoded and breakpoints are enabled. if the read protect option bit is e nabled, this bit can only be cleared by reset- ting the device, it cannot be written to 0. 0 = thez8 encore! xp f64xx series device is operating in normal mode. 1 = the z8 encore! xp f64xx series device is in debug mode. [6] ? brken breakpoint enable this bit controls the behavior of the brk instruction (op code 00h ). by default, breakpoints are disabled and the brk instruction behaves like a nop. if this bit is set to 1 and a brk instruction is decoded, the ocd takes action dependent upon the brkloop bit. 0 = brk instruction is disabled. 1 = brk instruction is enabled. [5] ? dbgack debug acknowledge this bit enables the debug acknowledge feature. if this bit is set to 1, then the ocd sends an debug acknowledge character (ffh) to the host when a breakpoint occurs. 0 = debug acknowledge is disabled. 1 = debug acknowledge is enabled.
ps019924-0113 p r e l i m i n a r y on-chip debugger control register z8 encore! xp ? f64xx series product specification 194 ocd status register the ocd status register, shown in table 104, reports status informa tion about the current state of the debugger and the system. [4] ? brkloop breakpoint loop this bit determines what action the ocd takes when a brk instruction is decoded if break- points are enabled (brken is 1). if this bit is 0, then the dbgmode bit is automatically set to 1 and the ocd entered debug mode. if brkloop is set to 1, then the ? ez8 cpu loops on the brk instruction. 0 = brk instruction sets dbgmode to 1. 1 = ez8 cpu loops on brk instruction. [3:1] reserved these bits are reserved and must be programmed to 000. [0] ? rst reset setting this bit to 1 resets the z8 encore! xp f64xx series devices. the devices go through a normal power-on reset sequence with the e xception that the on-chip debugger is not reset. this bit is automatically cl eared to 0 when the reset finishes. 0 = no effect. 1 = reset the z8 encore! xp f64xx series device. table 104. ocd status register (ocdstat) bit 7 6 5 4 3 2 1 0 field idle halt rpen reserved reset 0 r/w r bit description [7] ? idle cpu idle this bit is set if the part is in debug mode (d bgmode is 1), or if a brk instruction occurred since the last time ocdctl was wr itten. this can be used to de termine if the cpu is running or if it is idling. ? 0 = the ez8 cpu is running. ? 1 = the ez8 cpu is either stopped or looping on a brk instruction. [6] ? halt halt mode 0 = the device is not in halt mode. 1 = the device is in halt mode. bit description (continued)
ps019924-0113 p r e l i m i n a r y on-chip debugger control register z8 encore! xp ? f64xx series product specification 195 [5] ? rpen read protect option bit enabled 0 = the read protect option bit is disabled (1). 1 = the read protect option bit is ena bled (0), disabling many ocd commands. [4:0] reserved these bits are reserved and must be programmed to 00000. bit description (continued)
ps019924-0113 p r e l i m i n a r y on-chip oscillator z8 encore! xp ? f64xx series product specification 196 on-chip oscillator the products in the z8 encore! xp f64xx seri es feature an on-chip oscillator for use with external crystals with frequencies from 32 khz to 20 mhz. in addition, the oscillator can support external rc networks with oscillation frequencies up to 4 mh z or ceramic resona- tors with oscillation frequenci es up to 20 mhz. this oscilla tor generates the primary sys- tem clock for the internal ez8 cpu and the majority of the on-chip peripherals. alternatively, the x in input pin can also accept a cmos-l evel clock input signal (32 khz? 20 mhz). if an external clock generator is used, the x out pin must be left unconnected. when configured for use with cr ystal oscillators or external cl ock drivers, the frequency of the signal on the x in input pin determines the frequency of the system clock (that is, no internal clock divider). in rc operation, the system clock is driven by a clock divider (divide by 2) to ensure 50% duty cycle. operating modes the z8 encore! xp f64xx series products support four different oscillator modes: ? on-chip oscillator configured for use with external rc networks (< 4 mhz) ? minimum power for use with very low frequency crystals (32 khz to 1.0 mhz) ? medium power for use with medium frequency crystals or ceramic resonators (0.5 mhz to 10.0 mhz) ? maximum power for use with hi gh frequency crystals or ceramic resonators (8.0 mhz to 20.0 mhz) ? the oscillator mode is selected through user -programmable option b its. for more informa- tion, see the option bits chapter on page 180. crystal oscillator operation figure 40 displays a recommended configurat ion for connection with an external funda- mental-mode, parallel-resonant crystal operat ing at 20 mhz. recommended 20 mhz crys- tal specifications are provided in table 105. resistor r1 is optional and limits total power dissipation by the crystal. the printed circuit board layout must add no more than 4 pf of stray capacitance to either the x in or x out pins. if oscillation does not occur, reduce the values of capacitors c1 and c2 to decrease loading.
ps019924-0113 p r e l i m i n a r y cry stal oscillator operation z8 encore! xp ? f64xx series product specification 197 figure 40. recommended 20 mhz crystal oscillator configuration table 105. recommended crystal oscillator specifications (20 mhz operation) parameter value units comments frequency 20 mhz resonance parallel mode fundamental series resistance (r s ) 25 w maximum load capacitance (c l )2 0 p f m a x i m u m shunt capacitance (c 0 ) 7 pf maximum drive level 1 mw maximum c2 = 22pf c1 = 22pf crystal x out x in on-chip oscillator r1 = 220 ?
ps019924-0113 p r e l i m i n a r y oscillator operation with an external rc z8 encore! xp ? f64xx series product specification 198 oscillator operation with an external rc network the external rc oscillator mode is applic able to timing-inse nsitive applications. figure 41 displays a recommended configuratio n for connection with an external resistor- capacitor (rc) network. an external resistance value of 45 k ? is recommended for oscilla tor operation with an external rc network. the minimum resistan ce value to ensure operation is 40 k ? ?? the typical oscillator frequency can be esti mated from the values of the resistor ( r in k ? ) and capacitor ( c in pf) elements usi ng the following equation: figure 42 displays the typical (3.3 v and 25c) oscillator frequency as a function of the capacitor ( c in pf) employed in the rc network assuming a 45 k ? external resistor. for very small values of c, the parasitic capacitance of the oscillator x in pin and the printed circuit board should be included in th e estimation of the oscillator frequency. it is possible to operate the rc oscillator usin g only the parasitic ca pacitance of the pack- age and printed circuit board. to minimize sensitivity to external parasitics, external capacitance values in excess of 20 pf are recommended. figure 41. connecting the on-chip osci llator to an external rc network c x in r v dd oscillator frequency (khz) 1 6 ? 10 0.4 r c ?? ?? 4c ? ?? + --------------------------------------------------------- =
ps019924-0113 p r e l i m i n a r y oscillator operation with an external rc z8 encore! xp ? f64xx series product specification 199 when using the external rc oscillator mode, the oscillator may stop oscillating if the power supply drops below 2.7 v, but before the power supply drops to the voltage brown- out threshold. the oscillator w ill resume oscillation as soon as the supply voltage exceeds 2.7 v. figure 42. typical rc oscillator frequency as a function of the external capacitance with a 45 k ? resistor 0 250 500 750 1000 1250 1500 1750 2000 2250 2500 2750 3000 3250 3500 3750 4000 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 440 460 480 500 c (pf) frequency (khz) caution:
ps019924-0113 p r e l i m i n a r y electrical characteristics z8 encore! xp ? f64xx series product specification 200 electrical characteristics the data in this chapter represents all known data prior to qualifi cation and characteriza- tion of the z8 encore! xp f64xx series of pr oducts, and is therefore subject to change. additional electrical characteristics may be foun d in the individual chapters of this docu- ment. absolute maximum ratings stresses greater than those listed in table 10 6 may cause permanent damage to the device. these ratings are stress ratings only. operation of the device at any condition outside those indicated in the operational s ections of these specifications is not implied. exposure to absolute maximum rating cond itions for extended periods may affect device reliability. for improved reliability, unused inputs must be tied to one of the supply voltages (v dd or v ss ). table 106. absolute maximum ratings parameter minimum maximum units notes ambient temperature under bias ?40 +125 c storage temperature ?65 +150 c voltage on any pin with respect to v ss ?0.3 +5.5 v 1 voltage on v dd pin with respect to v ss ?0.3 +3.6 v maximum current on input and/or inactive output pin ?5 +5 a maximum output current from active output pin ?25 +25 ma 80-pin qfp maximum ratings at ?40c to 70c total power dissipation 550 mw maximum current into v dd or out of v ss 150 ma 80-pin qfp maximum ratings at 70c to 125c total power dissipation 200 mw maximum current into v dd or out of v ss 56 ma 68-pin plcc maximum ratings at ?40c to 70c total power dissipation 1000 mw maximum current into v dd or out of v ss 275 ma 68-pin plcc maximum ratings at 7 0c to 125c total power dissipation 500 mw maximum current into v dd or out of v ss 140 ma
ps019924-0113 p r e l i m i n a r y absolute maximum ratings z8 encore! xp ? f64xx series product specification 201 64-pin lqfp maximum ratings at ?40c to 70c total power dissipation 1000 mw maximum current into v dd or out of v ss 275 ma 64-pin lqfp maximum ratings at 70c to 125c total power dissipation 540 mw maximum current into v dd or out of v ss 150 ma 44-pin plcc maximum ratings at ?40c to 70c total power dissipation 750 mw maximum current into v dd or out of v ss 200 ma 44-pin plcc maximum ratings at 70c to 125c total power dissipation 295 mw maximum current into v dd or out of v ss 83 ma 44-pin lqfp maximum ratings at ?40c to 70c total power dissipation 750 mw maximum current into v dd or out of v ss 200 ma 44-pin lqfp maximum ratings at 70c to 125c total power dissipation 360 mw maximum current into v dd or out of v ss 100 ma note: this voltage applies to all pins, with the exception of v dd , av dd , pins supporting analog input (ports b and h), reset , and where noted otherwise. table 106. absolute maximum ratings (continued) parameter minimum maximum units notes
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 202 dc characteristics table 107 lists the dc characteristics of th e z8 encore! xp f64xx series products. all voltages are referenced to v ss , the primary system ground. table 107. dc characteristics symbol parameter t a = ?40c to 125c units conditions minimum typical maximum v dd supply voltage 3.0 ? 3.6 v v il1 low level input voltage ?0.3 ? 0.3*v dd v for all input pins except reset , dbg, x in v il2 low level input voltage ?0.3 ? 0.2*v dd v for reset , dbg, and x in . v ih1 high level input voltage 0.7*v dd ? 5.5 v port a, c, d, e, f, and g pins. v ih2 high level input voltage 0.7*v dd ?v dd +0.3 v port b and h pins. v ih3 high level input voltage 0.8*v dd ?v dd +0.3 v reset , dbg, and x in pins v ol1 low level output voltage standard drive ??0.4vi ol = 2 ma; v dd = 3.0 v ? high output drive dis- abled. v oh1 high level output voltage standard drive 2.4 ? ? v i oh = ?2 ma; v dd = 3.0 v ? high output drive dis- abled. v ol2 low level output voltage high drive ??0.6vi ol = 20 ma; v dd = 3.3 v ? high output drive enabled ? t a = ?40c to +70c v oh2 high level output voltage ? high drive 2.4 ? ? v i oh = ?20 ma; v dd = 3.3 v ? high output drive enabled; ? t a = ?40c to +70c v ol3 low level output voltage ? high drive ??0.6vi ol = 15 ma; v dd = 3.3 v ? high output drive enabled; ? t a = +70c to +105c notes: 1. this condition excludes all pins that have on-chip pull-ups, when driven low. 2. these values are provided for design guid ance only and are not tested in production.
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 203 v oh3 high level output voltage ? high drive 2.4 ? ? v i oh = 15 ma; v dd = 3.3 v ? high output drive enabled; ? t a = +70c to +105c v ram ram data retention 0.7 ? ? v i il input leakage current ?5 ? +5 a v dd = 3.6 v; ? v in = v dd or v ss 1 i tl tri-state leakage current ?5 ? +5 a v dd = 3.6 v c pad gpio port pad capacitance ?8.0 2 ?pf c xin x in pad capacitance ? 8.0 2 ?pf c xout x out pad capacitance ? 9.5 2 ?pf i pu weak pull-up current 30 100 350 ma v dd = 3.0?3.6 v i dda active mode supply current; gpio pins are configured as outputs (see figure 43 on page 205 and figure 44 on page 206) ?1116mav dd = 3.6 v, f sysclk = 20 mhz ??12mav dd = 3.3 v ?911mav dd = 3.6 v, f sysclk = 10 mhz ??9mav dd = 3.3 v i ddh halt mode supply current; gpio pins configured as outputs (see figure 45 on page 207 and figure 46 on page 208) ?47mav dd = 3.6 v, f sysclk = 20 mhz ??5mav dd = 3.3 v ?35mav dd = 3.6 v, f sysclk = 10 mhz ??4mav dd = 3.3 v table 107. dc characteristics (continued) symbol parameter t a = ?40c to 125c units conditions minimum typical maximum notes: 1. this condition excludes all pins that have on-chip pull-ups, when driven low. 2. these values are provided for design guid ance only and are not tested in production.
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 204 i dds stop mode supply current; gpio pins configured as outputs (see figure 47 on page 209 and figure 48 on page 210) ? 520 a vbo and wdt enabled 700 v dd = 3.6 v 650 v dd = 3.3 v ? 10 a vbo disabled, ? wdt enabled, ? t a = 0 to 70oc 25 v dd = 3.6 v 20 v dd = 3.3 v ? ? a vbo disabled, ? wdt enabled, ? t a = ?40 to +105oc 80 v dd = 3.6 v 70 v dd = 3.3 v ? ? a vbo disabled, ? wdt enabled, ? t a = ?40 to +125oc 250 v dd = 3.6 v 150 v dd = 3.3 v table 107. dc characteristics (continued) symbol parameter t a = ?40c to 125c units conditions minimum typical maximum notes: 1. this condition excludes all pins that have on-chip pull-ups, when driven low. 2. these values are provided for design guid ance only and are not tested in production.
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 205 figure 43 displays the typical active mode current consumption while operating at 25 oc plotted opposite the system clock frequency. all gpio pins are configured as outputs and driven high. figure 43. typical active mode i dd vs. system clock frequency 0 3 6 9 12 15 051 01 52 0 system clock frequency (mhz) idd (ma ) 3.0v 3.3v 3.6v
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 206 figure 44 displays the maximum active mode current consumption across the full operat- ing temperature range of the device and plotte d opposite the system clock frequency. all gpio pins are configured as outputs and driven high. figure 44. maximum active mode i dd vs. system clock frequency 0 3 6 9 12 15 0 5 10 15 20 system clock frequency (mhz) idd (ma) 3.0v 3.3v 3.6v
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 207 figure 45 displays the typical current co nsumption in halt mode while operating at 25oc plotted opposite the system clock frequenc y. all gpio pins are configured as outputs and driven high. figure 45. typical halt mode i dd vs. system clock frequency 0 1 2 3 4 5 0 5 10 15 20 system clock frequency (mhz) halt idd (ma ) 3.0v 3.3v 3.6v
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 208 figure 46 displays the maximum halt mode current consumption across the full operat- ing temperature range of the device and plotte d opposite the system clock frequency. all gpio pins are configured as outputs and driven high. figure 46. maximum halt mode i cc vs. system clock frequency 0 1 2 3 4 5 6 0 5 10 15 20 system clock frequency (mhz) halt idd (ma) 3.0v 3.3v 3.6v
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 209 figure 47 displays the maximum current consumption in stop mode with the vbo and watchdog timer enabled plotted opposite th e power supply voltage. all gpio pins are configured as outputs and driven high. figure 47. maximu m stop mode i dd with vbo enabled vs. power supply voltage 400 450 500 550 600 650 700 3.0 3.2 3.4 3.6 vdd (v) stop idd (microamperes) -40/105c 0/70c 25c typical
ps019924-0113 p r e l i m i n a r y dc characteristics z8 encore! xp ? f64xx series product specification 210 figure 48 displays the maximum current consumption in stop mode with the vbo dis- abled and watchdog timer enabled plotted op posite the power supply voltage. all gpio pins are configured as outputs and driven high. disabling the watchdog timer and its internal rc oscillator in stop mode will pr ovide some additional reduction in stop mode current consumption. this small curre nt reduction would be indistinguishable on the scale shown in the figure. figure 48. maximum stop mode i dd with vbo disabled vs. power supply voltage 0.00 20.00 40.00 60.00 80.00 100.00 120.00 3.0 3.2 3.4 3.6 vdd (v) stop idd (microamperes) 25c typical 0/70c -40/105c -40/+125c
ps019924-0113 p r e l i m i n a r y on-chip peripheral ac and dc electrical z8 encore! xp ? f64xx series product specification 211 on-chip peripheral ac and dc electrical characteristics table 108. power-on reset and voltage brow n-out electrical characteristics and timing symbol parameter t a = ?40c to 125c units conditions minimum typical* maximum v por power-on reset voltage threshold 2.40 2.70 2.90 v v dd = v por v vbo voltage brown-out reset voltage threshold 2.30 2.60 2.85 v v dd = v vbo v por to v vbo hysteresis 50 100 ? mv starting v dd voltage to ensure valid power-on reset. ?v ss ?v t ana power-on reset analog delay ?50?sv dd > v por ; t por digital reset delay follows t ana t por power-on reset digital delay ? 6.6 ? ms 66 wdt oscillator cycles (10 khz) + 16 system clock cycles (20 mhz) t vbo voltage brown-out pulse rejection period ?10?sv dd < v vbo to generate a reset. t ramp time for v dd to transition from v ss to v por to ensure valid reset 0.10 ? 100 ms note: *data in the typical column is from characterization at 3.3 v and 0c. these values are provided for design guid- ance only and are not tested in production.
ps019924-0113 p r e l i m i n a r y on-chip peripheral ac and dc electrical z8 encore! xp ? f64xx series product specification 212 table 109. external rc oscillator elec trical characteristics and timing symbol parameter t a = ?40c to 125c units conditions minimum typical* maximum v dd operating voltage range 2.70 1 ??v r ext external resistance from x in to v dd 40 45 200 k ? v dd = v vbo c ext external capacitance from x in to v ss 0 20 1000 pf f osc external rc oscillation frequency ??4mhz note: *when using the external rc oscillator mode, the oscilla tor may stop oscillating if the power supply drops below 2.7 v, but before the power supply drop s to the voltage brown-out threshold. the oscillator will resume oscilla- tion as soon as the supply voltage exceeds 2.7 v. table 110. reset and stop mode recovery pin timing symbol parameter t a = ?40c to 125c units conditions minimum typical maximum t reset reset pin assertion to initiate a system reset. 4??t clk not in stop mode. ? t clk = system clock period. t smr stop mode recovery pin pulse rejection period 10 20 40 ns reset, dbg, and gpio pins configured as smr sources.
ps019924-0113 p r e l i m i n a r y on-chip peripheral ac and dc electrical z8 encore! xp ? f64xx series product specification 213 table 111 list the flash memory el ectrical characteristics and timing. table 112 lists the watchdog timer electrical characteristics and timing. table 111. flash memory electr ical characteristics and timing parameter v dd = 3.0?3.6 v t a = ?40c to 125c units notes minimum typical maximum flash byte read time 50 ? ? ns flash byte program time 20 ? 40 s flash page erase time 10 ? ? ms flash mass erase time 200 ? ? ms writes to single address before next erase ??2 flash row program time ? ? 8 ms cumulative program time for single row cannot exceed limit before next erase. this parameter is only an issue when bypassing the flash controller. data retention 100 ? ? years 25c endurance, ?40c to 105c 10,000 ? ? cycles program/erase cycles endurance, 106c to 125c 1,000 ? ? cycles program/erase cycles table 112. watchdog timer electrical characteristics and timing symbol parameter v dd = 3.0?3.6 v t a = ?40c to 125c units conditions minimum typical maximum f wdt wdt oscillator frequency 51020khz i wdt wdt oscillator current including internal rc oscillator ?< 15a
ps019924-0113 p r e l i m i n a r y on-chip peripheral ac and dc electrical z8 encore! xp ? f64xx series product specification 214 table 113 provides electrical characteristi cs and timing informatio n for the analog-to- digital converter. figure 49 displays the input frequency response of the adc. table 113. analog-to-digital converter electrical characteristics and timing symbol parameter v dd = 3.0 v?3.6 v t a = ?40c to 125c units conditions minimum typical maximum resolution 10 ? ? bits external v ref = 3.0 v; differential nonlinearity (dnl) ?1.0 +1.0 lsb guaranteed by design integral nonlinearity (inl) ?3.0 + 1.0 3.0 lsb external v ref = 3.0 v dc offset error ?35 ? 25 mv 80-pin qfp and 64-pin lqfp packages. dc offset error ?50 ? 25 mv 44-pin lqfp, 44-pin plcc, and 68-pin plcc packages. v ref internal reference voltage 1.9 2.0 2.4 v v dd = 3.0 v?3.6 v ? t a = ?40c to 105c vc ref voltage coefficient of internal reference voltage ?78?mv/vv ref variation as a func- tion of av dd . tc ref temperature coefficient of internal reference voltage ?1?mv/c single-shot conversion period ? 5129 ? cycles system clock cycles continuous conversion period ? 256 ? cycles system clock cycles r s analog source impedance ? ? 150 w recommended zin input impedance 150 k ? 20mhz system clock. input impedance increases with lower sys- tem clock frequency. v ref external reference voltage av dd vav dd <= v dd . when using an external refer- ence voltage, decoupling capacitance should be placed from v ref to av ss .
ps019924-0113 p r e l i m i n a r y on-chip peripheral ac and dc electrical z8 encore! xp ? f64xx series product specification 215 i ref current draw into v ref pin when driving with external source. 25.0 40.0 ? a figure 49. analog-to-digital converter frequency response table 113. analog-to-digital converter electrical characteristics and timing (continued) symbol parameter v dd = 3.0 v?3.6 v t a = ?40c to 125c units conditions minimum typical maximum frequency (khz) 0.9 0.8 0.7 0.6 0.3 0.4 0.2 0.1 0 frequency response 1 0.5 0 5 10 15 20 25 30 ?6 db ?3 db adc magnitude transfer function (linear scale)
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 216 ac characteristics this section provides ac characteristics and tim ing data which assumes a standard load of 50 pf on all outputs. table 114 lists the z8 encore! xp f64xx seri es ac characteristics and timing. table 114. ac characteristics symbol parameter v dd = 3.0 v?3.6v t a = ?40c to 125c units conditions minimum maximum f sysclk system clock frequency ? 20.0 mhz read-only from flash memory. 0.032768 20.0 mhz program or erasure of flash memory. f xtal crystal oscillator frequency 0.032768 20.0 mhz system clock frequencies below the crystal oscillator mini- mum require an external clock driver. t xin crystal oscillator clock period 50 ? ns t clk = 1/f sysclk t xinh system clock high time 20 ns t xinl system clock low time 20 ns t xinr system clock rise time ? 3 ns t clk = 50 ns. slower rise times can be tolerated with longer clock periods. t xinf system clock fall time ? 3 ns t clk = 50 ns. slower fall times can be tolerated with longer clock periods.
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 217 general-purpose i/o port input data sample timing figure 50 displays timing of the gpio port input sampling. table 115 lists the gpio port input timing. figure 50. port input sample timing table 115. gpio port input timing parameter abbreviation delay (ns) min max t s_port port input transition to x in fall setup time (not pictured) 5 ? t h_port x in fall to port input transition hold time (not pictured) 6 ? t smr gpio port pin pulse width to in sure stop mode recovery (for gpio port pins enabled as smr sources) 1 ? s system tclk gpio pin port value changes to 0 0 latched into port input input value gpio input data latch clock data register gpio data read on data bus gpio data register value 0 read by ez8 cpu
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 218 general-purpose i/o port output timing figure 51 and table 116 provide timi ng information for gpio port pins. figure 51. gpio port output timing table 116. gpio port output timing parameter abbreviation delay (ns) minimum maximum gpio port pins t 1 x in rise to port output valid delay ? 20 t 2 x in rise to port output hold time 2 ? x in port output tclk t1 t2
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 219 on-chip debugger timing figure 52 and table 117 provide timing information for the dbg pin. the dbg pin tim- ing specifications assume a 4 s maximum rise and fall time. figure 52. on-chip debugger timing table 117. on-chip debugger timing parameter abbreviation delay (ns) minimum maximum dbg t 1 x in rise to dbg valid delay ? 30 t 2 x in rise to dbg output hold time 2 ? t 3 dbg to x in rise input setup time 10 ? t 4 dbg to x in rise input hold time 5 ? dbg frequency system clock/4 x in dbg tclk t1 t2 (output) dbg t3 t4 (input) output data input data
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 220 spi master mode timing figure 53 and table 118 provide timing information for spi master mode pins. timing is shown with sck rising edge used to source mosi output data, sck falling edge used to sample miso input data. timing on the ss output pin(s) is controlled by software. figure 53. spi master mode timing table 118. spi master mode timing parameter abbreviation delay (ns) min max spi master t 1 sck rise to mosi output valid delay ?5 +5 t 2 miso input to sck (receive edge) setup time 20 t 3 miso input to sck (receive edge) hold time 0 sck mosi t1 (output) miso t2 t3 (input) output data input data
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 221 spi slave mode timing figure 54 and table 119 provide timing information for the spi slave mode pins. timing is shown with sck rising edge used to sour ce miso output data, sck falling edge used to sample mosi input data. figure 54. spi slave mode timing table 119. spi slave mode timing parameter abbreviation delay (ns) minimum maximum spi slave t 1 sck (transmit edge) to miso output valid delay 2 * x in period 3 * x in period + 20 nsec t 2 mosi input to sck (rec eive edge) setup time 0 t 3 mosi input to sck (receive edge) hold time 3 * x in period t 4 ss input assertion to sck setup 1 * x in period sck miso t1 (output) mosi t2 t3 (input) output data input data ss (input) t4
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 222 i 2 c timing figure 55 and table 120 prov ide timing information for i 2 c pins. figure 55. i 2 c timing table 120. i 2 c timing parameter abbreviation delay (ns) minimum maximum i 2 c t 1 scl fall to sda output delay scl period/4 t 2 sda input to scl rising edge setup time 0 t 3 sda input to scl falling edge hold time 0 scl sda t1 (output) sda t2 nput) output data input data (output) t3
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 223 uart timing figure 56 and table 121 provide timing info rmation for uart pins for the case where the clear to send input pin (cts ) is used for flow control. in this example, it is assumed that the driver enable polarity has been configured to be active low and is represented here by de . the cts to de assertion delay (t1) assumes the uart transmit data register has been loaded with data prior to cts assertion. figure 56. uart timing with cts table 121. uart timing with cts parameter abbreviation delay (ns) minimum maximum t 1 cts fall to de assertion delay 2 * x in period 2 * x in period + 1 bit period t 2 de assertion to txd falling edge (start ) delay 1 bit period 1 bit period + ? 1 * x in period t 3 end of stop bit(s) to de deassertion delay 1 * x in period 2 * x in period t 1 t 2 txd (output) de (output) cts (input) start bit 0 t 3 bit 7 parity stop bit 1 end of stop bit(s)
ps019924-0113 p r e l i m i n a r y ac characteristics z8 encore! xp ? f64xx series product specification 224 figure 57 and table 122 provide timing info rmation for uart pins for the case where the clear to send input signal (cts ) is not used for flow control. in this example, it is assumed that the driver enable polarity has been configured to be active low and is rep- resented here by de . de asserts after the uart transmit data register has been written. de remains asserted for multiple characters as long as the transmit data register is writ- ten with the next character before the current character has completed. figure 57. uart timing without cts table 122. uart timing without cts parameter abbreviation delay (ns) minimum maximum t 1 de assertion to txd falling edge (start) delay 1 bit period 1 bit period + ? 1 * x in period t 2 end of stop bit(s) to de deassertion delay 1 * x in period 2 * x in period t 1 txd (output) de (output) start bit 0 t 2 bit 7 parity stop bit 1 end of stop bit(s)
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction set z8 encore! xp ? f64xx series product specification 225 ez8 cpu instruction set this chapter describes the following feat ures of the ez8 cpu instruction set: assembly language programming introduction : see page 225 a ssembly language syntax : see page 226 ez8 cpu instruction notation : see page 227 ez8 cpu instruction classes : see page 230 ez8 cpu instruction summary : see page 234 assembly language programming introduction the ez8 cpu assembly language provides a me ans for writing an application program without having to be concerned with actual memory addresses or machine instruction for- mats. a program written in assembly language is called a source program. assembly lan- guage allows the use of symbolic addresses to identify memory locations. it also allows mnemonic codes (op codes and operands) to re present the instructions themselves. the op codes identify the instruction wh ile the operands represent memory locations, registers, or immediate data values. each assembly language program consists of a series of symbolic commands called state- ments. each statement can contain labe ls, operations, operands and comments. labels can be assigned to a particular instru ction step in a source program. the label iden- tifies that step in the program as an entry point for use by other instructions. the assembly language also includes assembl er directives that supplement the machine instruction. the assembler directives, or p seudo-ops, are not transl ated into a machine instruction. rather, the pseudo-ops are interp reted as directives that control or assist the assembly process. the source program is processed (assembled) by the assembler to obtain a machine lan- guage program called the object code. the object code is executed by the ez8 cpu. an example segment of an assembly language pr ogram is detailed in the following example.
ps019924-0113 p r e l i m i n a r y assembly language syntax z8 encore! xp ? f64xx series product specification 226 assembly language s ource program example assembly language syntax for proper instruction execution, ez8 cpu ass embly language syntax requires that the operands be written as destination, source . after assembly, the object code usually pres- ents the operands in the source, destination order; however, ordering is op code-depen- dent. the following instruction examples illu strate the format of some basic assembly instructions and the resulting object code prod uced by the assembler. this binary format must be followed if you prefer manual program coding or intend to implement your own assembler. example 1. if the contents of registers 43h and 08h are added and the re sult is stored in 43h , the assembly syntax and resulting object code result is shown in table 123. example 2. in general, when an instruction format requires an 8-bit register address, that address can specify any regist er location in the range 0?255 or, using escaped mode addressing, a working register r0?r15. if the contents of register 43h and working register r8 are added and the result is stored in 43h , the assembly syntax and resulting object code result is shown in table 124. jp start ; everything after the semicolon is a comment. start: ; a label called ?start?. the first instruction ; (jp start) in this example causes program ; execution to jump to the point within the ; program where the start label occurs. ld r4, r7 ; a load (ld) instruction with two operands. the ; first operand, working register r4, is the ; destination. the second operand, working ; register r7, is the source. the contents of r7 ; is written into r4. ld 234h, #%01 ; another load (ld) instruction with two operands. ; the first operand, extended mode register ; address 234h, identifies the destination. the ; second operand, immediate data value 01h, is the ; source. the value 01h is written into the ; register at address 234h. table 123. assembly language syntax example 1 assembly language code add 43h, 08h (add dst, src) object code 04 08 43 (opc src, dst)
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction notation z8 encore! xp ? f64xx series product specification 227 refer to the device-specific product specificatio n to determine the exact register file range available. the register file size va ries, depending on the device type. ez8 cpu instruction notation in the ez8 cpu instruction summary and description sections, the operands, condition codes, status flags, and addr ess modes are represented by a notational shorthand that is described in table 125. table 124. assembly language syntax example 2 assembly language code add 43h, r8 (add dst, src) object code 04 e8 43 (opc src, dst) table 125. notational shorthand notation description operand range b bit b b represents a value from 0 to 7 (000b to 111b). cc condition code ? refer to condition codes overview in the ez8 cpu user manual. da direct address addrs addrs. represents a number in the range of 0000h to ffffh. er extended addressing regis- ter reg reg. represents a number in the range of 000h to fffh. im immediate data #data data is a number between 00h to ffh. ir indirect working register @rn n = 0 ?15. ir indirect register @reg reg. represents a number in the range of 00h to ffh. irr indirect working register pair @rrp p = 0, 2, 4, 6, 8, 10, 12, or 14. irr indirect register pair @reg reg. represents an even number in the range 00h to feh. p polarity p polarity is a single bit binary value of either 0b or 1b. r working register rn n = 0 ? 15. r register reg reg. represents a number in the range of 00h to ffh.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction notation z8 encore! xp ? f64xx series product specification 228 table 126 contains additional symbols that are used throughout the instruction summary and instruction set description sections. assignment of a value is indicated by an arrow, as shown in the following example. dst dst + src this example indicates that the source data is added to the destina tion data; the result is stored in the destination location. ra relative address x x represents an index in the range of +127 to ?128 which is an offset relative to the address of the next instruction. rr working register pair rrp p = 0, 2, 4, 6, 8, 10, 12, or 14. rr register pair reg reg. represents an even number in the range of 00h to feh. vector vector address vector vector represents a number in the range of 00h to ffh. x indexed #index the register or register pair to be indexed is offset by the signed index value (#index) in a +127 to ?128 range. table 126. additional symbols symbol definition dst destination operand src source operand @ indirect address prefix sp stack pointer pc program counter flags flags register rp register pointer # immediate operand prefix b binary number suffix % hexadecimal number prefix h hexadecimal number suffix table 125. notational shorthand (continued) notation description operand range
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction notation z8 encore! xp ? f64xx series product specification 229 condition codes the c, z, s and v flags control the operatio n of the conditional jump (jp cc and jr cc) instructions. sixteen frequently useful functions of the flag settings are encoded in a 4-bit field called the condition code (cc), which form s bits 7:4 of the conditional jump instruc- tions. the condition codes are summarized in table 127. some binary condition codes can be created using more than one assembly code mnemonic. the result of the flag test oper- ation decides if the cond itional jump is executed. table 127. condition codes binary hex assembly mnemonic definition flag test operation 0000 0 f always false ? 0001 1 lt less than (s xor v) = 1 0010 2 le less than or equal (z or (s xor v)) = 1 0011 3 ule unsigned less than or equal (c or z) = 1 0100 4 ov overflow v = 1 0101 5 ml minus s = 1 0110 6 z zero z = 1 0110 6 eq equal z = 1 0111 7 c carry c = 1 0111 7 ult unsigned less than c = 1 1000 8 t (or blank) always true ? 1001 9 ge greater than or equal (s xor v) = 0 1010 a gt greater than (z or (s xor v)) = 0 1011 b ugt unsigned greater than (c = 0 and z = 0) = 1 1100 c nov no overflow v = 0 1101 d pl plus s = 0 1110 e nz non-zero z = 0 1110 e ne not equal z = 0 1111 f nc no carry c = 0 1111 f uge unsigned greater than or equal c = 0
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction classes z8 encore! xp ? f64xx series product specification 230 ez8 cpu instruction classes ez8 cpu instructions can be divided fu nctionally into the following groups: ? arithmetic ? bit manipulation ? block transfer ? cpu control ? load ? logical ? program control ? rotate and shift ? tables 128 through 135 contain the instructio ns belonging to each group and the number of operands required for each instruction. some instructions appear in more than one table; these instructions can be considered to be a subset of more than one category. within these tables, the sour ce operand is identified as src , the destination operand is dst and a condition code is cc . table 128. arithmetic instructions mnemonic operands instruction adc dst, src add with carry adcx dst, src add with carry using extended addressing add dst, src add addx dst, src add using extended addressing cp dst, src compare cpc dst, src compare with carry cpcx dst, src compare with carry using extended addressing cpx dst, src compare using extended addressing da dst decimal adjust dec dst decrement decw dst decrement word inc dst increment incw dst increment word
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction classes z8 encore! xp ? f64xx series product specification 231 mult dst multiply sbc dst, src subtract with carry sbcx dst, src subtract with carry using extended addressing sub dst, src subtract subx dst, src subtract using extended addressing table 129. bit manipulation instructions mnemonic operands instruction bclr bit, dst bit clear bit p, bit, dst bit set or clear bset bit, dst bit set bswap dst bit swap ccf ? complement carry flag rcf ? reset carry flag scf ? set carry flag tcm dst, src test comp lement under mask tcmx dst, src test complement under mask using extended addressing tm dst, src test under mask tmx dst, src test under mask using extended addressing table 130. block transfer instructions mnemonic operands instruction ldci dst, src load constant to/from program memory and auto-incre- ment addresses ldei dst, src load external data to/from data memory and auto-incre- ment addresses table 128. arithmetic instructions (continued) mnemonic operands instruction
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction classes z8 encore! xp ? f64xx series product specification 232 table 131. cpu control instructions mnemonic operands instruction atm ? atomic execution ccf ? complement carry flag di ? disable interrupts ei ? enable interrupts halt ? halt mode nop ? no operation rcf ? reset carry flag scf ? set carry flag srp src set regi ster pointer stop ? stop mode wdt ? watchdog timer refresh table 132. load instructions mnemonic operands instruction clr dst clear ld dst, src load ldc dst, src load constant to/from program memory ldci dst, src load constant to/from program memory and auto-incre- ment addresses lde dst, src load external data to/from data memory ldei dst, src load external data to/from data memory and auto-incre- ment addresses ldwx dst, src load word using extended addressing ldx dst, src load using extended addressing lea dst, x(src) load effective address pop dst pop popx dst pop using extended addressing push src push pushx src push using extended addressing
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction classes z8 encore! xp ? f64xx series product specification 233 table 133. logical instructions mnemonic operands instruction and dst, src logical and andx dst, src logical and using extended addressing com dst complement or dst, src logical or orx dst, src logical or using extended addressing xor dst, src logical exclusive or xorx dst, src logical exclusive or using extended address- ing table 134. program control instructions mnemonic operands instruction brk ? on-chip debugger break btj p, bit, src, da bit test and jump btjnz bit, src, da bit test and jump if non-zero btjz bit, src, da bit test and jump if zero call dst call procedure djnz dst, src, ra decrement and jump non-zero iret ? interrupt return jp dst jump jp cc dst jump conditional jr da jump relative jr cc da jump relative conditional ret ? return trap vector software trap
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 234 ez8 cpu instruction summary table 136 summarizes the ez8 cpu instruc tions. the table identifies the addressing modes employed by the instruction, the effect upon the flags register, the number of cpu clock cycles required for th e instruction fetch, and the number of cpu clock cycles required for the instruction execution. table 135. rotate and shift instructions mnemonic operands instruction bswap dst bit swap rl dst rotate left rlc dst rotate left through carry rr dst rotate right rrc dst rotate right through carry sra dst shift right arithmetic srl dst shift right logical swap dst swap nibbles table 136. ez8 cpu instruction summary assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h adc dst, src dst dst + src + c r r 12 * * * * 0 * 2 3 rir 13 2 4 rr 14 3 3 rir 15 3 4 rim 16 3 3 ir im 17 3 4 adcx dst, src dst dst + src + c er er 18 * * * * 0 * 4 3 er im 19 4 3 note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 235 add dst, src dst dst + src r r 02 * * * * 0 * 2 3 rir 03 2 4 rr 04 3 3 rir 05 3 4 rim 06 3 3 ir im 07 3 4 addx dst, src dst dst + src er er 08 * * * * 0 * 4 3 er im 09 4 3 and dst, src dst dst and src r r 52 ? * * 0 ? ? 2 3 rir 53 2 4 rr 54 3 3 rir 55 3 4 rim 56 3 3 ir im 57 3 4 andx dst, src dst dst and src er er 58 ? * * 0 ? ? 4 3 er im 59 4 3 atm block all interrupt and dma requests during execution of the next 3 instructions 2f ?????? 1 2 bclr bit, dst dst[bit] 0 r e2 ?????? 2 2 bit p, bit, dst dst[bit] p r e2 ?????? 2 2 brk debugger break 00 ? ? ? ? ? ? 1 1 bset bit, dst dst[bit] 1 r e2 ?????? 2 2 bswap dst dst[7:0] dst[0:7] r d5 x * * 0 ? ? 2 2 btj p, bit, src, dst if src[bit] = p ? pc pc + x r f6 ?????? 3 3 ir f7 3 4 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 236 btjnz bit, src, dst if src[bit] = 1 ? pc pc + x r f6 ?????? 3 3 ir f7 3 4 btjz bit, src, dst if src[bit] = 0 ? pc pc + x r f6 ?????? 3 3 ir f7 3 4 call dst sp sp ?2 ? @sp pc ? pc dst irr d4 ?????? 2 6 da d6 3 3 ccf c ~c ef *????? 1 2 clr dst dst 00h r b0 ?????? 2 2 ir b1 2 3 com dst dst ~dst r 60 ? * * 0 ? ? 2 2 ir 61 2 3 cp dst, src dst ? src r r a2 * * * * ? ? 2 3 rir a3 2 4 rr a4 3 3 rir a5 3 4 rim a6 3 3 ir im a7 3 4 cpc dst, src dst ? src ? c r r 1f a2 * * * * ? ? 3 3 rir 1f a3 3 4 rr 1f a4 4 3 rir 1f a5 4 4 rim 1f a6 4 3 ir im 1f a7 4 4 cpcx dst, src dst ? src ? c er er 1f a8 * * * * ? ? 5 3 er im 1f a9 5 3 cpx dst, src dst ? src er er a8 * * * * ? ? 4 3 er im a9 4 3 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 237 da dst dst da(dst) r 40 * * * x ? ? 2 2 ir 41 2 3 dec dst dst dst ? 1 r 30 ? * * * ? ? 2 2 ir 31 2 3 decw dst dst dst ? 1 rr 80 ? * * * ? ? 2 5 irr 81 2 6 di irqctl[7] 0 8f ?????? 1 2 djnz dst, ra dst dst ? 1 ? if dst ? 0 ? pc pc + x r 0a?fa ?????? 2 3 ei irqctl[7] 1 9f ?????? 1 2 halt halt mode 7f ?????? 1 2 inc dst dst dst + 1 r 20 ? * * * ? ? 2 2 ir 21 2 3 r0 e ? f e 12 incw dst dst dst + 1 rr a0 ? * * * ? ? 2 5 irr a1 2 6 iret flags @sp ? sp sp + 1 ? pc @sp ? sp sp + 2 ? irqctl[7] 1 bf ****** 1 5 jp dst pc dst da 8d ?????? 3 2 irr c4 2 3 jp cc, dst if cc is true ? pc dst da 0d?fd ?????? 3 2 jr dst pc pc + x da 8b ?????? 2 2 jr cc, dst if cc is true ? pc pc + x da 0b?fb ?????? 2 2 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 238 ld dst, rc dst src r im 0c?fc ?????? 2 2 rx(r) c7 3 3 x(r) r d7 3 4 rir e3 2 3 rr e4 3 2 rir e5 3 4 rim e6 3 2 ir im e7 3 3 ir r f3 2 3 ir r f5 3 3 ldc dst, src dst src r irr c2 ?????? 2 5 ir irr c5 2 9 irr r d2 2 5 ldci dst, src dst src ? r r + 1 ? rr rr + 1 ir irr c3 ?????? 2 9 irr ir d3 2 9 lde dst, src dst src r irr 82 ?????? 2 5 irr r 92 2 5 ldei dst, src dst src ? r r + 1 ? rr rr + 1 ir irr 83 ?????? 2 9 irr ir 93 2 9 ldwx dst, src dst src er er 1f e8 ?????? 54 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 239 ldx dst, src dst src r er 84 ?????? 3 2 ir er 85 3 3 rirr 86 3 4 ir irr 87 3 5 r x(rr) 88 3 4 x(rr) r 89 3 4 er r 94 3 2 er ir 95 3 3 irr r 96 3 4 irr ir 97 3 5 er er e8 4 2 er im e9 4 2 lea dst, x(src) dst src + x r x(r) 98 ?????? 3 3 rr x(rr) 99 3 5 mult dst dst[15:0] ? dst[15:8] * dst[7:0] rr f4 ?????? 2 8 nop no operation 0f ? ? ? ? ? ? 1 2 or dst, src dst dst or src r r 42 ? * * 0 ? ? 2 3 rir 43 2 4 rr 44 3 3 rir 45 3 4 rim 46 3 3 ir im 47 3 4 orx dst, src dst dst or src er er 48 ? * * 0 ? ? 4 3 er im 49 4 3 pop dst dst @sp ? sp sp + 1 r 50 ?????? 2 2 ir 51 2 3 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 240 popx dst dst @sp sp sp + 1 er d8 ?????? 3 2 push src sp sp ? 1 @sp src r 70 ?????? 2 2 ir 71 2 3 im 1f 70 3 2 pushx src sp sp ? 1 ? @sp src er c8 ?????? 3 2 rcf c 0 cf 0????? 1 2 ret pc @sp ? sp sp + 2 af ?????? 1 4 rl dst r 90 * * * * ? ? 2 2 ir 91 2 3 rlc dst r 10 * * * * ? ? 2 2 ir 11 2 3 rr dst r e0 ****?? 2 2 ir e1 2 3 rrc dst r c0 * * * * ? ? 2 2 ir c1 2 3 sbc dst, src dst dst ? src ? c r r 32 * * * * 1 * 2 3 rir 33 2 4 rr 34 3 3 rir 35 3 4 rim 36 3 3 ir im 37 3 4 sbcx dst, src dst dst ? src ? c er er 38 * * * * 1 * 4 3 er im 39 4 3 scf c 1 df 1????? 1 2 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1. d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 241 sra dst r d0 * * * 0 ? ? 2 2 ir d1 2 3 srl dst r 1f c0 * * 0 * ? ? 3 2 ir 1f c1 3 3 srp src rp src im 01 ?????? 2 2 stop stop mode 6f ?????? 1 2 sub dst, src dst dst ? src r r 22 * * * * 1 * 2 3 rir 23 2 4 rr 24 3 3 rir 25 3 4 rim 26 3 3 ir im 27 3 4 subx dst, src dst dst ? src er er 28 * * * * 1 * 4 3 er im 29 4 3 swap dst dst[7:4] ? dst[3:0] r f0 x * * x ? ? 2 2 ir f1 2 3 tcm dst, src (not dst) and src r r 62 ? * * 0 ? ? 2 3 rir 63 2 4 rr 64 3 3 rir 65 3 4 rim 66 3 3 ir im 67 3 4 tcmx dst, src (not dst) and src er er 68 ? * * 0 ? ? 4 3 er im 69 4 3 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1. d7 d6 d5 d4 d3 d2 d1 d0 dst c d7 d6 d5 d4 d3 d2 d1 d0 dst c 0
ps019924-0113 p r e l i m i n a r y ez8 cpu instruction summary z8 encore! xp ? f64xx series product specification 242 tm dst, src dst and src r r 72 ? * * 0 ? ? 2 3 rir 73 2 4 rr 74 3 3 rir 75 3 4 rim 76 3 3 ir im 77 3 4 tmx dst, src dst and src er er 78 ? * * 0 ? ? 4 3 er im 79 4 3 trap vector sp sp ? 2 ? @sp pc ? sp sp ? 1 ? @sp flags ? pc @vector vecto r f2 ?????? 2 6 wdt 5f ?????? 1 2 xor dst, src dst dst xor src r r b2 ? * * 0 ? ? 2 3 rir b3 2 4 rr b4 3 3 rir b5 3 4 rim b6 3 3 ir im b7 3 4 xorx dst, src dst dst xor src er er b8 ? * * 0 ? ? 4 3 er im b9 4 3 table 136. ez8 cpu instruction summary (continued) assembly ? mnemonic symbolic operation address mode opcode(s) (hex) flags fetch cycles instr. cycles dst src c z s v d h note: flags notation: * = value is a function of the result of the operation. ? ? = unaffected. ? x = undefined. 0 = reset to 0. ? 1 = set to 1.
ps019924-0113 p r e l i m i n a r y flags register z8 encore! xp ? f64xx series product specification 243 flags register the flags register contains the status inform ation regarding the most recent arithmetic, logical, bit manipulation or rotate and shift oper ation. the flags register contains six bits of status information that are set or cleared by cpu operations. four of the bits (c, v, z and s) can be tested for use with conditiona l jump instructions. two flags, h and d, can- not be tested and are used for bina ry-coded decimal (bcd) arithmetic. the two remaining bits, user flags f1 and f2, are available as general-purpose status bits. user flags are unaffected by arithmetic operatio ns and must be set or cleared by instruc- tions. the user flags cannot be used with conditional jumps. they ar e undefined at initial power-up and are unaffected by reset. figure 58 displays the flags and their bit positions in the flags register. interrupts, the software trap (trap) instructio n, and illegal instruction traps all write the value of the flags register to the stack. ex ecuting an interrupt return (iret) instruction restores the value saved on the stack into the flags register. note:u = undefined. figure 58. flags register c z s v d h f2 f1 flags register bit 0 bit 7 half carry flag decimal adjust flag overflow flag sign flag zero flag carry flag user flags
ps019924-0113 p r e l i m i n a r y op code maps z8 encore! xp ? f64xx series product specification 244 op code maps a description of the op code map data and the abbreviations are provided in figure 59 and table 137. figures 60 and 61 provide informa tion about each of the ez8 cpu instructions. figure 59. op code map cell description table 137. op code map abbreviations abbreviation description abbreviation description b bit position irr indirect register pair cc condition code p polarity (0 or 1) x 8-bit signed index or displacement r 4-bit working register da destination address r 8-bit register er extended addressing register r1, r1, ir1, irr1, ir1, rr1, rr1, irr1, er1 destination address cp 3.3 r2,r1 a 4 op code lower nibble second operand after assembly first operand after assembly opcode upper nibble instruction cycles fetch cycles
ps019924-0113 p r e l i m i n a r y op code maps z8 encore! xp ? f64xx series product specification 245 im immediate data value r2, r2, ir2, irr2, ir2, rr2, rr2, irr2, er2 source address ir indirect working register ra relative ir indirect register rr working register pair irr indirect working register pair rr register pair table 137. op code map abbreviations (continued) abbreviation description abbreviation description
ps019924-0113 p r e l i m i n a r y op code maps z8 encore! xp ? f64xx series product specification 246 figure 60. first op code map cp 3.3 r2,r1 cp 3.4 ir2,r1 cp 2.3 r1,r2 cp 2.4 r1,ir2 cpx 4.3 er2,er1 cpx 4.3 im,er1 cp 3.3 r1,im cp 3.4 ir1,im rrc 2.2 r1 rrc 2.3 ir1 0 1 2 3 4 5 6 7 8 9abcde f 0 1 2 3 4 5 6 7 8 9 a b c d e f lower nibble (hex) upper nibble (hex) brk 1.2 srp 2.2 im add 2.3 r1,r2 add 2.4 r1,ir2 add 3.3 r2,r1 add 3.4 ir2,r1 add 3.3 r1,im add 3.4 ir1,im addx 4.3 er2,er1 addx 4.3 im,er1 djnz 2.3 r1,x jr 2.2 cc,x ld 2.2 r1,im jp 3.2 cc,da inc 1.2 r1 nop 1.2 rlc 2.2 r1 rlc 2.3 ir1 adc 2.3 r1,r2 adc 2.4 r1,ir2 adc 3.3 r2,r1 adc 3.4 ir2,r1 adc 3.3 r1,im adc 3.4 ir1,im adcx 4.3 er2,er1 adcx 4.3 im,er1 inc 2.2 r1 inc 2.3 ir1 sub 2.3 r1,r2 sub 2.4 r1,ir2 sub 3.3 r2,r1 sub 3.4 ir2,r1 sub 3.3 r1,im sub 3.4 ir1,im subx 4.3 er2,er1 subx 4.3 im,er1 dec 2.2 r1 dec 2.3 ir1 sbc 2.3 r1,r2 sbc 2.4 r1,ir2 sbc 3.3 r2,r1 sbc 3.4 ir2,r1 sbc 3.3 r1,im sbc 3.4 ir1,im sbcx 4.3 er2,er1 sbcx 4.3 im,er1 da 2.2 r1 da 2.3 ir1 or 2.3 r1,r2 or 2.4 r1,ir2 or 3.3 r2,r1 or 3.4 ir2,r1 or 3.3 r1,im or 3.4 ir1,im orx 4.3 er2,er1 orx 4.3 im,er1 pop 2.2 r1 pop 2.3 ir1 and 2.3 r1,r2 and 2.4 r1,ir2 and 3.3 r2,r1 and 3.4 ir2,r1 and 3.3 r1,im and 3.4 ir1,im andx 4.3 er2,er1 andx 4.3 im,er1 com 2.2 r1 com 2.3 ir1 tcm 2.3 r1,r2 tcm 2.4 r1,ir2 tcm 3.3 r2,r1 tcm 3.4 ir2,r1 tcm 3.3 r1,im tcm 3.4 ir1,im tcmx 4.3 er2,er1 tcmx 4.3 im,er1 push 2.2 r2 push 2.3 ir2 tm 2.3 r1,r2 tm 2.4 r1,ir2 tm 3.3 r2,r1 tm 3.4 ir2,r1 tm 3.3 r1,im tm 3.4 ir1,im tmx 4.3 er2,er1 tmx 4.3 im,er1 decw 2.5 rr1 decw 2.6 irr1 lde 2.5 r1,irr2 ldei 2.9 ir1,irr2 ldx 3.2 r1,er2 ldx 3.3 ir1,er2 ldx 3.4 irr2,r1 ldx 3.5 irr2,ir1 ldx 3.4 r1,rr2,x ldx 3.4 rr1,r2,x rl 2.2 r1 rl 2.3 ir1 lde 2.5 r2,irr1 ldei 2.9 ir2,irr1 ldx 3.2 r2,er1 ldx 3.3 ir2,er1 ldx 3.4 r2,irr1 ldx 3.5 ir2,irr1 lea 3.3 r1,r2,x lea 3.5 rr1,rr2,x incw 2.5 rr1 incw 2.6 irr1 clr 2.2 r1 clr 2.3 ir1 xor 2.3 r1,r2 xor 2.4 r1,ir2 xor 3.3 r2,r1 xor 3.4 ir2,r1 xor 3.3 r1,im xor 3.4 ir1,im xorx 4.3 er2,er1 xorx 4.3 im,er1 ldc 2.5 r1,irr2 ldci 2.9 ir1,irr2 ldc 2.5 r2,irr1 ldci 2.9 ir2,irr1 jp 2.3 irr1 ldc 2.9 ir1,irr2 ld 3.4 r1,r2,x pushx 3.2 er2 sra 2.2 r1 sra 2.3 ir1 popx 3.2 er1 ld 3.4 r2,r1,x call 2.6 irr1 bswap 2.2 r1 call 3.3 da ld 3.2 r2,r1 ld 3.3 ir2,r1 bit 2.2 p,b,r1 ld 2.3 r1,ir2 ldx 4.2 er2,er1 ldx 4.2 im,er1 ld 3.2 r1,im ld 3.3 ir1,im rr 2.2 r1 rr 2.3 ir1 mult 2.8 rr1 ld 3.3 r2,ir1 trap 2.6 vector ld 2.3 ir1,r2 btj 3.3 p,b,r1,x btj 3.4 p,b,ir1,x swap 2.2 r1 swap 2.3 ir1 rcf 1.2 wdt 1.2 stop 1.2 halt 1.2 di 1.2 ei 1.2 ret 1.4 iret 1.5 scf 1.2 ccf 1.2 opcode see 2nd map 1,2 atm
ps019924-0113 p r e l i m i n a r y op code maps z8 encore! xp ? f64xx series product specification 247 figure 61. second op code map after 1fh cpc 4.3 r2,r1 cpc 4.4 ir2,r1 cpc 3.3 r1,r2 cpc 3.4 r1,ir2 cpcx 5.3 er2,er1 cpcx 5.3 im,er1 cpc 4.3 r1,im cpc 4.4 ir1,im srl 3.2 r1 srl 3.3 ir1 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f lower nibble (hex) upper nibble (hex) 3,2 push im 5,4 ldwx er2,er1
ps019924-0113 p r e l i m i n a r y general purpose ram z8 encore! xp ? f64xx series product specification 248 appendix b. register tables for the reader?s convenience, this appendix lists all f64xx series registers numerically by hexadecimal address. general purpose ram in the f64xx series, the 000?fff hexadecimal address range is partitioned for general- purpose random access memory, as follows. hex addresses: 000?7ff this address range is reserved for 2 kb genera l-purpose register file ram devices. for more details, see the register file section on page 18. hex addresses: 000?fff this address range is reserved for 4 kb genera l-purpose register file ram devices. for more details, see the register file section on page 18. timer 0 for more information about these timer control registers, see the timer control register definitions section on page 72. hex address: f00 table 138. timer 0?3 high byte register (txh) bit 7 6 5 4 3 2 1 0 field th reset 0 r/w r/w address f00h, f08h, f10h, f18h
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 249 hex address: f01 hex address: f02 hex address: f03 hex address: f04 table 139. timer 0?3 low byte register (txl) bit 7 6 5 4 3 2 1 0 field tl reset 01 r/w r/w address f01h, f09h, f11h, f19h table 140. timer 0?3 reload high byte register (txrh) bit 7 6 5 4 3 2 1 0 field trh reset 1 r/w r/w address f02h, f0ah, f12h, f1ah table 141. timer 0?3 reload low byte register (txrl) bit 7 6 5 4 3 2 1 0 field trl reset 1 r/w r/w address f03h, f0bh, f13h, f1bh table 142. timer 0?3 pwm high byte register (txpwmh) bit 7 6 5 4 3 2 1 0 field pwmh reset 0 r/w r/w address f04h, f0ch, f14h, f1ch
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 250 hex address: f05 hex address: f06 hex address: f07 hex address: f08 table 143. timer 0?3 pwm low byte register (txpwml) bit 7 6 5 4 3 2 1 0 field pwml reset 0 r/w r/w address f05h, f0dh, f15h, f1dh table 144. timer 0?3 control 0 register (txctl0) bit 7 6 5 4 3 2 1 0 field reserved csc reserved reset 0 r/w r/w address f06h, f0eh, f16h, f1eh table 145. timer 0?3 control 1 register (txctl1) bit 7 6 5 4 3 2 1 0 field ten tpol pres tmode reset 0 r/w r/w address f07h, f0fh, f17h, f1fh table 146. timer 0?3 high byte register (txh) bit 7 6 5 4 3 2 1 0 field th reset 0 r/w r/w address f00h, f08h, f10h, f18h
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 251 hex address: f09 hex address: f0a hex address: f0b hex address: f0c table 147. timer 0?3 low byte register (txl) bit 7 6 5 4 3 2 1 0 field tl reset 01 r/w r/w address f01h, f09h, f11h, f19h table 148. timer 0?3 reload high byte register (txrh) bit 7 6 5 4 3 2 1 0 field trh reset 1 r/w r/w address f02h, f0ah, f12h, f1ah table 149. timer 0?3 reload low byte register (txrl) bit 7 6 5 4 3 2 1 0 field trl reset 1 r/w r/w address f03h, f0bh, f13h, f1bh table 150. timer 0?3 pwm high byte register (txpwmh) bit 7 6 5 4 3 2 1 0 field pwmh reset 0 r/w r/w address f04h, f0ch, f14h, f1ch
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 252 hex address: f0d hex address: f0e hex address: f0f hex address: f10 table 151. timer 0?3 pwm low byte register (txpwml) bit 7 6 5 4 3 2 1 0 field pwml reset 0 r/w r/w address f05h, f0dh, f15h, f1dh table 152. timer 0?3 control 0 register (txctl0) bit 7 6 5 4 3 2 1 0 field reserved csc reserved reset 0 r/w r/w address f06h, f0eh, f16h, f1eh table 153. timer 0?3 control 1 register (txctl1) bit 7 6 5 4 3 2 1 0 field ten tpol pres tmode reset 0 r/w r/w address f07h, f0fh, f17h, f1fh table 154. timer 0?3 high byte register (txh) bit 7 6 5 4 3 2 1 0 field th reset 0 r/w r/w address f00h, f08h, f10h, f18h
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 253 hex address: f11 hex address: f12 hex address: f13 hex address: f14 table 155. timer 0?3 low byte register (txl) bit 7 6 5 4 3 2 1 0 field tl reset 01 r/w r/w address f01h, f09h, f11h, f19h table 156. timer 0?3 reload high byte register (txrh) bit 7 6 5 4 3 2 1 0 field trh reset 1 r/w r/w address f02h, f0ah, f12h, f1ah table 157. timer 0?3 reload low byte register (txrl) bit 7 6 5 4 3 2 1 0 field trl reset 1 r/w r/w address f03h, f0bh, f13h, f1bh table 158. timer 0?3 pwm high byte register (txpwmh) bit 7 6 5 4 3 2 1 0 field pwmh reset 0 r/w r/w address f04h, f0ch, f14h, f1ch
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 254 hex address: f15 hex address: f16 hex address: f17 hex address: f18 table 159. timer 0?3 pwm low byte register (txpwml) bit 7 6 5 4 3 2 1 0 field pwml reset 0 r/w r/w address f05h, f0dh, f15h, f1dh table 160. timer 0?3 control 0 register (txctl0) bit 7 6 5 4 3 2 1 0 field reserved csc reserved reset 0 r/w r/w address f06h, f0eh, f16h, f1eh table 161. timer 0?3 control 1 register (txctl1) bit 7 6 5 4 3 2 1 0 field ten tpol pres tmode reset 0 r/w r/w address f07h, f0fh, f17h, f1fh table 162. timer 0?3 high byte register (txh) bit 7 6 5 4 3 2 1 0 field th reset 0 r/w r/w address f00h, f08h, f10h, f18h
ps019924-0113 p r e l i m i n a r y timer 0 z8 encore! xp ? f64xx series product specification 255 hex address: f19 hex address: f1a hex address: f1b hex address: f1c table 163. timer 0?3 low byte register (txl) bit 7 6 5 4 3 2 1 0 field tl reset 01 r/w r/w address f01h, f09h, f11h, f19h table 164. timer 0?3 reload high byte register (txrh) bit 7 6 5 4 3 2 1 0 field trh reset 1 r/w r/w address f02h, f0ah, f12h, f1ah table 165. timer 0?3 reload low byte register (txrl) bit 7 6 5 4 3 2 1 0 field trl reset 1 r/w r/w address f03h, f0bh, f13h, f1bh table 166. timer 0?3 pwm high byte register (txpwmh) bit 7 6 5 4 3 2 1 0 field pwmh reset 0 r/w r/w address f04h, f0ch, f14h, f1ch
ps019924-0113 p r e l i m i n a r y universal asynchronous receiver/ z8 encore! xp ? f64xx series product specification 256 hex address: f1d hex address: f1e hex address: f1f hex addresses: f20?f39 this address range is reserved. universal asynchronous receiver/transmitter (uart) for more information about these uart control registers, see the uart control regis- ter definitions section on page 98. table 167. timer 0?3 pwm low byte register (txpwml) bit 7 6 5 4 3 2 1 0 field pwml reset 0 r/w r/w address f05h, f0dh, f15h, f1dh table 168. timer 0?3 control 0 register (txctl0) bit 7 6 5 4 3 2 1 0 field reserved csc reserved reset 0 r/w r/w address f06h, f0eh, f16h, f1eh table 169. timer 0?3 control 1 register (txctl1) bit 7 6 5 4 3 2 1 0 field ten tpol pres tmode reset 0 r/w r/w address f07h, f0fh, f17h, f1fh
ps019924-0113 p r e l i m i n a r y universal asynchronous receiver/ z8 encore! xp ? f64xx series product specification 257 hex address: f40 hex address: f41 hex address: f42 table 170. uart transmit data register (u x txd) bit 7 6 5 4 3 2 1 0 field txd reset x r/w w address f40h and f48h table 171. uart receive data register (u x rxd) bit 7 6 5 4 3 2 1 0 field rxd reset x r/w r address f40h and f48h table 172. uart status 0 register (u x stat0) bit 7 6 5 4 3 2 1 0 field rda pe oe fe brkd tdre txe cts reset 01x r/w r address f41h and f49h table 173. uart control 0 register (u x ctl0) bit 7 6 5 4 3 2 1 0 field ten ren ctse pen psel sbrk stop lben reset 0 r/w r/w address f42h and f4ah
ps019924-0113 p r e l i m i n a r y universal asynchronous receiver/ z8 encore! xp ? f64xx series product specification 258 hex address: f43 hex address: f44 hex address: f45 hex address: f46 table 174. uart control 1 register (u x ctl1) bit 7 6 5 4 3 2 1 0 field mpmd[1] mpen mpmd[0] mpbt depol brgctl rdairq iren reset 0 r/w r/w address f43h and f4bh table 175. uart status 1 register (u x stat1) bit 7 6 5 4 3 2 1 0 field reserved newfrm mprx reset 0 r/w rr/wr address f44h and f4ch table 176. uart address compare register (u x addr) bit 7 6 5 4 3 2 1 0 field comp_addr reset 0 r/w r/w address f45h and f4dh table 177. uart baud rate high byte register (u x brh) bit 7 6 5 4 3 2 1 0 field brh reset 1 r/w r/w address f46h and f4eh
ps019924-0113 p r e l i m i n a r y universal asynchronous receiver/ z8 encore! xp ? f64xx series product specification 259 hex address: f47 hex address: f48 hex address: f49 table 178. uart baud rate low byte register (u x brl) bit7 7 6 5 4 3 2 1 0 field brl reset 1 r/w r/w address f47h and f4fh table 179. uart transmit data register (u x txd) bit 7 6 5 4 3 2 1 0 field txd reset x r/w w address f40h and f48h table 180. uart receive data register (u x rxd) bit 7 6 5 4 3 2 1 0 field rxd reset x r/w r address f40h and f48h table 181. uart status 0 register (u x stat0) bit 7 6 5 4 3 2 1 0 field rda pe oe fe brkd tdre txe cts reset 01x r/w r address f41h and f49h
ps019924-0113 p r e l i m i n a r y universal asynchronous receiver/ z8 encore! xp ? f64xx series product specification 260 hex address: f4a hex address: f4b hex address: f4c hex address: f4d table 182. uart control 0 register (u x ctl0) bit 7 6 5 4 3 2 1 0 field ten ren ctse pen psel sbrk stop lben reset 0 r/w r/w address f42h and f4ah table 183. uart control 1 register (u x ctl1) bit 7 6 5 4 3 2 1 0 field mpmd[1] mpen mpmd[0] mpbt depol brgctl rdairq iren reset 0 r/w r/w address f43h and f4bh table 184. uart status 1 register (u x stat1) bit 7 6 5 4 3 2 1 0 field reserved newfrm mprx reset 0 r/w rr/wr address f44h and f4ch table 185. uart address compare register (u x addr) bit 7 6 5 4 3 2 1 0 field comp_addr reset 0 r/w r/w address f45h and f4dh
ps019924-0113 p r e l i m i n a r y inter-integrated circuit (i2c) z8 encore! xp ? f64xx series product specification 261 hex address: f4e hex address: f4f inter-integrated circuit (i 2 c) for more information about these i 2 c control registers, see the i 2 c control register def- initions section on page 141. hex address: f50 table 186. uart baud rate high byte register (u x brh) bit 7 6 5 4 3 2 1 0 field brh reset 1 r/w r/w address f46h and f4eh table 187. uart baud rate low byte register (u x brl) bit7 7 6 5 4 3 2 1 0 field brl reset 1 r/w r/w address f47h and f4fh table 188. i 2 c data register (i2cdata) bit 7 6 5 4 3 2 1 0 field data reset 0 r/w r/w address f50h
ps019924-0113 p r e l i m i n a r y inter-integrated circuit (i2c) z8 encore! xp ? f64xx series product specification 262 hex address: f51 hex address: f52 hex address: f53 hex address: f54 table 189. i 2 c status register (i2cstat) bit 7 6 5 4 3 2 1 0 field tdre rdrf ack 10b rd tas dss ncki reset 10 r/w r address f51h table 190. i 2 c control register (i2cctl) bit 7 6 5 4 3 2 1 0 field ien start stop birq txi nak flush filten reset 0 r/w r/w r/w1 r/w1 r/w r/w r/w1 w1 r/w address f52h table 191. i 2 c baud rate high byte register (i2cbrh) bit 7 6 5 4 3 2 1 0 field brh reset ffh r/w r/w address f53h table 192. i 2 c baud rate low byte register (i2cbrl) bit 7 6 5 4 3 2 1 0 field brl reset ffh r/w r/w address f54h
ps019924-0113 p r e l i m i n a r y serial peripheral interface z8 encore! xp ? f64xx series product specification 263 hex address: f55 hex address: f56 hex addresses: f57?f5f this address range is reserved. serial peripheral interface for more information about these spi control registers, see the s pi control register def- initions section on page 121. hex address: f60 table 193. i 2 c diagnostic state register (i2cdst) bit 7 6 5 4 3 2 1 0 field sclin sdain stpcnt txrxstate reset x0 r/w r address f55h table 194. i 2 c diagnostic control register (i2cdiag) bit 7 6 5 4 3 2 1 0 field reserved diag reset 0 r/w rr/w address f56h table 195. spi data register (spidata) bit 7 6 5 4 3 2 1 0 field data reset x r/w r/w address f60h
ps019924-0113 p r e l i m i n a r y serial peripheral interface z8 encore! xp ? f64xx series product specification 264 hex address: f61 hex address: f62 hex address: f63 table 196. spi control register (spictl) bit 7 6 5 4 3 2 1 0 field irqe str birq phase clkpol wor mmen spien reset 0 r/w r/w address f61h table 197. spi status register (spistat) bit 7 6 5 4 3 2 1 0 field irq ovr col abt reserved txst slas reset 01 r/w r/w* r address f62h note: r/w* = read access. write a 1 to clear the bit to 0. table 198. spi mode register (spimode) bit 7 6 5 4 3 2 1 0 field reserved diag num bits[2:0] ssio ssv reset 0 r/w rr / w address f63h
ps019924-0113 p r e l i m i n a r y serial peripheral interface z8 encore! xp ? f64xx series product specification 265 hex address: f64 hex address: f65 this address is reserved. hex address: f66 hex address: f67 hex addresses: f68?f6f this address range is reserved. table 199. spi diagnostic state register (spidst) bit 7 6 5 4 3 2 1 0 field scken tcken spistate reset 0 r/w r address f64h table 200. spi baud rate hi gh byte register (spibrh) bit 7 6 5 4 3 2 1 0 field brh reset 1 r/w r/w address f66h table 201. spi baud rate low byte register (spibrl) bit 7 6 5 4 3 2 1 0 field brl reset 1 r/w r/w address f67h
ps019924-0113 p r e l i m i n a r y analog-to-digital converter (adc) z8 encore! xp ? f64xx series product specification 266 analog-to-digital converter (adc) for more information about these adc control registers, see the adc control register definitions section on page 165. hex addresses: f70?f71 this address range is reserved. hex address: f72 hex address: f73 hex addresses: f74?faf this address range is reserved. direct memory access (dma) for more information about these dma control registers, see the dma control register definitions section on page 152. table 202. adc data high byte register (adcd_h) bit 7 6 5 4 3 2 1 0 field adcd_h reset x r/w r address f72h table 203. adc data low bits register (adcd_l) bit 7 6 5 4 3 2 1 0 field adcd_l reserved reset x r/w r address f73h
ps019924-0113 p r e l i m i n a r y direct memory access (dma) z8 encore! xp ? f64xx series product specification 267 hex address: fb0 hex address: fb1 hex address: fb2 hex address: fb3 table 204. dma x control register (dma x ctl) bit 7 6 5 4 3 2 1 0 field den dle ddir irqen wsel rss reset 0 r/w r/w address fb0h, fb8h table 205. dma x i/o address register (dma x io) bit 7 6 5 4 3 2 1 0 field dma_io reset x r/w r/w address fb1h, fb9h table 206. dma x address high nibble register (dma x h) bit 7 6 5 4 3 2 1 0 field dma_end_h dma_start_h reset x r/w r/w address fb2h, fbah table 207. dma x start/current address low byte register (dma x start) bit 7 6 5 4 3 2 1 0 field dma_start reset x r/w r/w address fb3h, fbbh
ps019924-0113 p r e l i m i n a r y direct memory access (dma) z8 encore! xp ? f64xx series product specification 268 hex address: fb4 hex addresses: fb5?fb7 this address range is reserved. hex address: fb8 hex address: fb9 table 208. dma x end address low byte register (dma x end) bit 7 6 5 4 3 2 1 0 field dma_end reset x r/w r/w address fb4h, fbch table 209. dma x control register (dma x ctl) bit 7 6 5 4 3 2 1 0 field den dle ddir irqen wsel rss reset 0 r/w r/w address fb0h, fb8h table 210. dma x i/o address register (dma x io) bit 7 6 5 4 3 2 1 0 field dma_io reset x r/w r/w address fb1h, fb9h
ps019924-0113 p r e l i m i n a r y direct memory access (dma) z8 encore! xp ? f64xx series product specification 269 hex address: fba hex address: fbb hex address: fbc hex address: fbd table 211. dma x address high nibble register (dma x h) bit 7 6 5 4 3 2 1 0 field dma_end_h dma_start_h reset x r/w r/w address fb2h, fbah table 212. dma x start/current address low byte register (dma x start) bit 7 6 5 4 3 2 1 0 field dma_start reset x r/w r/w address fb3h, fbbh table 213. dma x end address low byte register (dma x end) bit 7 6 5 4 3 2 1 0 field dma_end reset x r/w r/w address fb4h, fbch table 214. dma_adc address register (dmaa_addr) bit 7 6 5 4 3 2 1 0 field dmaa_addr reserved reset x r/w r/w address fbdh
ps019924-0113 p r e l i m i n a r y interrupt request (irq) z8 encore! xp ? f64xx series product specification 270 hex address: fbe hex address: fbf interrupt request (irq) for more information about these irq control registers, see the i nterrupt control register definitions section on page 51. hex address: fc0 table 215. dma_adc control register (dmaactl) bit 7 6 5 4 3 2 1 0 field daen irqen reserved adc_in reset 0 r/w r/w address fbeh table 216. dma_adc status register (dmaa_stat) bit 7 6 5 4 3 2 1 0 field cadc[3:0] reserved irqa irq1 irq0 reset 0 r/w r address fbfh table 217. interrupt request 0 register (irq0) bit 7 6 5 4 3 2 1 0 field t2i t1i t0i u0rxi u0txi i2ci spii adci reset 0 r/w r/w address fc0h
ps019924-0113 p r e l i m i n a r y interrupt request (irq) z8 encore! xp ? f64xx series product specification 271 hex address: fc1 hex address: fc2 hex address: fc3 hex address: fc4 table 218. irq0 enable hi gh bit register (irq0enh) bit 7 6 5 4 3 2 1 0 field t2enh t1enh t0enh u0renh u0tenh i2cenh spienh adcenh reset 0 r/w r/w address fc1h table 219. irq0 enable lo w bit register (irq0enl) bit 7 6 5 4 3 2 1 0 field t2enl t1enl t0enl u0renl u0tenl i2cenl spienl adcenl reset 0 r/w r/w address fc2h table 220. interrupt request 1 register (irq1) bit 7 6 5 4 3 2 1 0 field pad7i pad6i pad5i pad4i pad3i pad2i pad1i pad0i reset 0 r/w r/w address fc3h table 221. irq1 enable hi gh bit register (irq1enh) bit 7 6 5 4 3 2 1 0 field pad7enh pad6enh pad5enh pad4enh pad3enh pad2enh pad1enh pad0enh reset 00000000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address fc4h
ps019924-0113 p r e l i m i n a r y interrupt request (irq) z8 encore! xp ? f64xx series product specification 272 hex address: fc5 hex address: fc6 hex address: fc7 hex address: fc8 table 222. irq1 enable lo w bit register (irq1enl) bit 7 6 5 4 3 2 1 0 field pad7enl pad6enl pad5enl pad4enl pad3enl pad2enl pad1enl pad0enl reset 00000000 r/w r/wr/wr/wr/wr/wr/wr/wr/w address fc5h table 223. interrupt request 2 register (irq2) bit 7 6 5 4 3 2 1 0 field t3i u1rxi u1txi dmai pc3i pc2i pc1i pc0i reset 0 r/w r/w address fc6h table 224. irq2 enable hi gh bit register (irq2enh) bit 7 6 5 4 3 2 1 0 field t3enh u1renh u1tenh dmaenh c3enh c2enh c1enh c0enh reset 0 r/w r/w address fc7h table 225. irq2 enable lo w bit register (irq2enl) bit 7 6 5 4 3 2 1 0 field t3enl u1renl u1tenl dmaenl c3enl c2enl c1enl c0enl reset 0 r/w r/w address fc8h
ps019924-0113 p r e l i m i n a r y interrupt request (irq) z8 encore! xp ? f64xx series product specification 273 hex addresses: fc9?fcc this address range is reserved. hex address: fcd hex address: fce hex address: fcf table 226. interrupt edge select register (irqes) bit 7 6 5 4 3 2 1 0 field ies7 ies6 ies5 ies4 ies3 ies2 ies1 ies0 reset 0 r/w r/w address fcdh table 227. interrupt port select register (irqps) bit 7 6 5 4 3 2 1 0 field pad7s pad6s pad5s pad4s pad3s pad2s pad1s pad0s reset 0 r/w r/w address fceh table 228. interrupt control register (irqctl) bit 7 6 5 4 3 2 1 0 field irqe reserved reset 0 r/w r/w r address fcfh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 274 general-purpose input/output (gpio) for more information about these gpio control registers, see the gpio control register definitions section on page 39. hex address: fd0 hex address: fd1 hex address: fd2 table 229. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 230. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 231. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 275 hex address: fd3 hex address: fd4 hex address: fd5 hex address: fd6 table 232. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 233. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 234. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 235. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 276 hex address: fd7 hex address: fd8 hex address: fd9 hex address: fda table 236. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 237. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 238. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 239. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 277 hex address: fdb hex address: fdc hex address: fdd hex address: fde table 240. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 241. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 242. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 243. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 278 hex address: fdf hex address: fe0 hex address: fe1 hex address: fe2 table 244. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 245. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 246. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 247. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 279 hex address: fe3 hex address: fe4 hex address: fe5 hex address: fe6 table 248. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 249. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 250. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 251. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 280 hex address: fe7 hex address: fe8 hex address: fe9 hex address: fea table 252. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 253. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 254. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 255. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y general-purpose input/output (gpio) z8 encore! xp ? f64xx series product specification 281 hex address: feb hex address: fec hex address: fed hex address: fee table 256. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 257. port a ? h gpio address registers (p x addr) bit 7 6 5 4 3 2 1 0 field paddr[7:0] reset 00h r/w r/w address fd0h, fd4h, fd8h, fdch, fe0h, fe4h, fe8h, fech table 258. port a ? h control registers (p x ctl) bit 7 6 5 4 3 2 1 0 field pctl reset 00h r/w r/w address fd1h, fd5h, fd9h, fddh, fe1h, fe5h, fe9h, fedh table 259. port a ? h input data registers (pxin) bit 7 6 5 4 3 2 1 0 field pin7 pin6 pin5 pin4 pin3 pin2 pin1 pin0 reset x r/w r address fd2h, fd6h, fdah, fdeh, fe2h, fe6h, feah, feeh
ps019924-0113 p r e l i m i n a r y watchdog timer z8 encore! xp ? f64xx series product specification 282 hex address: fef watchdog timer for more information about these watch dog timer control registers, see the watchdog timer control register definitions section on page 83. hex address: ff0 hex address: ff1 table 260. port a ? h output data register (p x out) bit 7 6 5 4 3 2 1 0 field pout7 pout6 pout5 pout4 pout3 pout2 pout1 pout0 reset 0 r/w r/w address fd3h, fd7h, fdbh, fdfh, fe3h, fe7h, febh, fefh table 261. watchdog timer control register (wdtctl) bit 7 6 5 4 3 2 1 0 field por stop wdt ext reserved sm reset see table 48 on page 84. 0 r/w r address ff0h table 262. watchdog timer reload upper byte register (wdtu) bit 7 6 5 4 3 2 1 0 field wdtu reset 1 r/w r/w* address ff1h note: *r/w = read returns the current wdt count va lue; write sets the app ropriate reload value.
ps019924-0113 p r e l i m i n a r y watchdog timer z8 encore! xp ? f64xx series product specification 283 hex address: ff2 hex address: ff3 hex addresses: ff4?ff7 this address range is reserved. table 263. watchdog timer reload high byte register (wdth) bit 7 6 5 4 3 2 1 0 field wdth reset 1 r/w r/w* address ff2h note: *r/w = read returns the current wdt count va lue; write sets the appropriate reload value. table 264. watchdog timer reload low byte register (wdtl) bit 7 6 5 4 3 2 1 0 field wdtl reset 1 r/w r/w* address ff3h note: *r/w = read returns the current wdt count va lue; write sets the appropriate reload value.
ps019924-0113 p r e l i m i n a r y flash z8 encore! xp ? f64xx series product specification 284 flash for more information about these fl ash control registers, see the flash control register definitions section on page 175. hex address: ff8 hex address: ff9 table 265. flash control register (fctl) bit 7 6 5 4 3 2 1 0 field fcmd reset 0 r/w w address ff8h table 266. flash status register (fstat) bit 7 6 5 4 3 2 1 0 field reserved fstat reset 0 r/w r address ff8h table 267. page select register (fps) bit 7 6 5 4 3 2 1 0 field info_en page reset 0 r/w r/w address ff9h
ps019924-0113 p r e l i m i n a r y flash z8 encore! xp ? f64xx series product specification 285 hex address: ffa hex address: ffb hex addresses: ffc?fff refer to the ez8 cpu core user manual (um0128) table 268. flash sector protect register (fprot) bit 7 6 5 4 3 2 1 0 field sect7 sect6 sect5 sect4 sect3 sect2 sect1 sect0 reset 0 r/w r/w* address ff9h note: *r/w = this register is accessible for read operations; it can be written to 1 only via user code. table 269. flash frequency high byte register (ffreqh) bit 7 6 5 4 3 2 1 0 field ffreqh reset 0 r/w r/w address ffah table 270. flash frequency low byte register (ffreql) bit 7 6 5 4 3 2 1 0 field ffreql reset 0 r/w r/w address ffbh
ps019924-0113 p r e l i m i n a r y packaging z8 encore! xp ? f64xx series product specification 286 packaging zilog?s f64xx series of mcus includes the z8f1621, z8f2421, z8f3221, z8f4821 and z8f6421 devices, which are avai lable in the fo llowing packages: ? 40-pin pin dual inline package (pdip) ? 44-pin low profile quad flat package (lqfp) ? 44-pin plastic lead chip carrier (plcc) ? zilog?s f64xx series of mcus also includes the z8f1622, z8f2422, z8f3222, z8f4822 and z8f6422 devices, which are ava ilable in the following packages: ? 64-pin low-profile quad flat package (lqfp) ? 68-pin plastic lead chip carrier (plcc) ? lastly, zilog?s f64xx series of mcus includ es the z8f4823 and z8f6423 devices, which are available in the following package: ? 80-pin quad flat package (qfp) ? current diagrams for each of the se packages are published in zilog?s p ackaging product specification (ps0072) , which is available free for do wnload from the zilog website.
ps019924-0113 p r e l i m i n a r y ordering information z8 encore! xp ? f64xx series product specification 287 ordering information order your f64xx series products from zilog using the part numbers shown in table 271. for more information about ordering, please consult your local zilog sales office. the sales location page on the zilog website lists all regional offices. table 271. z8 encore! xp f64xx series ordering matrix part number flash ram i/o lines interrupts 16-bit timers w/pwm 10-bit a/d channels i 2 c spi uarts with irda description z8f642x with 64 kb flash, 10-bit analog -to-digital converter standard temperature: 0c to 70c z8f6421pm020sg 64 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f6421an020sg 64 kb 4 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f6421vn020sg 64 kb 4 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f6422ar020sg 64 kb 4 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f6422vs020sg 64 kb 4 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f6423ft020sg 64 kb 4 kb 60 24 4 12 1 1 2 qfp 80-pin package extended temperature: ?40c to +105c z8f6421pm020eg 64 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f6421an020eg 64 kb 4 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f6421vn020eg 64 kb 4 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f6422ar020eg 64 kb 4 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f6422vs020eg 64 kb 4 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f6423ft020eg 64 kb 4 kb 60 24 4 12 1 1 2 qfp 80-pin package automotive/industrial temperature: ?40c to +125c z8f6421pm020ag 64 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f6421an020ag 64 kb 4 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f6421vn020ag 64 kb 4 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f6422ar020ag 64 kb 4 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f6422vs020ag 64 kb 4 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f6423ft020ag 64 kb 4 kb 60 24 4 12 1 1 2 qfp 80-pin package
ps019924-0113 p r e l i m i n a r y ordering information z8 encore! xp ? f64xx series product specification 288 z8f482x with 48 kb flash, 10-bit analog -to-digital converter standard temperature: 0c to 70c z8f4821pm020sg 48 kb 4 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f4821an020sg 48 kb 4 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f4821vn020sg 48 kb 4 kb 31 23 3 8 1 1 2 plcc 44-pin package Z8F4822AR020SG 48 kb 4 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f4822vs020sg 48 kb 4 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f4823ft020sg 48 kb 4 kb 60 24 4 12 1 1 2 qfp 80-pin package extended temperature: ?40c to +105c z8f4821pm020eg 48 kb 4 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f4821an020eg 48 kb 4 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f4821vn020eg 48 kb 4 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f4822ar020eg 48 kb 4 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f4822vs020eg 48 kb 4 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f4823ft020eg 48 kb 4 kb 60 24 4 12 1 1 2 qfp 80-pin package automotive/industrial temperature: ?40c to +125c z8f4821pm020ag 48 kb 4 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f4821an020ag 48 kb 4 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f4821vn020ag 48 kb 4 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f4822ar020ag 48 kb 4 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f4822vs020ag 48 kb 4 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f4823ft020ag 48 kb 4 kb 60 24 4 12 1 1 2 qfp 80-pin package table 271. z8 encore! xp f64xx series ordering matrix part number flash ram i/o lines interrupts 16-bit timers w/pwm 10-bit a/d channels i 2 c spi uarts with irda description
ps019924-0113 p r e l i m i n a r y ordering information z8 encore! xp ? f64xx series product specification 289 z8f322x with 32 kb flash, 10-bit analog -to-digital converter standard temperature: 0c to 70c z8f3221pm020sg 32 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f3221an020sg 32 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f3221vn020sg 32 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f3222ar020sg 32 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f3222vs020sg 32 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package extended temperature: ?40c to 105c z8f3221pm020eg 32 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f3221an020eg 32 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f3221vn020eg 32 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f3222ar020eg 32 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f3222vs020eg 32 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package automotive/industrial temperature: ?40c to 125c z8f3221pm020ag 32 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f3221an020ag 32 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f3221vn020ag 32 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f3222ar020ag 32 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f3222vs020ag 32 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package table 271. z8 encore! xp f64xx series ordering matrix part number flash ram i/o lines interrupts 16-bit timers w/pwm 10-bit a/d channels i 2 c spi uarts with irda description
ps019924-0113 p r e l i m i n a r y ordering information z8 encore! xp ? f64xx series product specification 290 z8f242x with 24 kb flash, 10-bit analog -to-digital converter standard temperature: 0c to 70c z8f2421pm020sg 24 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f2421an020sg 24 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f2421vn020sg 24 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f2422ar020sg 24 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f2422vs020sg 24 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package extended temperature: ?40c to 105c z8f2421pm020eg 24 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f2421an020eg 24 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f2421vn020eg 24 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f2422ar020eg 24 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f2422vs020eg 24 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package automotive/industrial temperature: ?40c to 125c z8f2421pm020ag 24 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f2421an020ag 24 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f2421vn020ag 24 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f2422ar020ag 24 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f2422vs020ag 24 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package table 271. z8 encore! xp f64xx series ordering matrix part number flash ram i/o lines interrupts 16-bit timers w/pwm 10-bit a/d channels i 2 c spi uarts with irda description
ps019924-0113 p r e l i m i n a r y ordering information z8 encore! xp ? f64xx series product specification 291 z8f162x with 16 kb flash, 10-bit analog -to-digital converter standard temperature: 0c to 70c z8f1621pm020sg 16 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f1621an020sg 16 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f1621vn020sg 16 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f1622ar020sg 16 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f1622vs020sg 16 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package extended temperature: ?40c to +105c z8f1621pm020eg 16 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f1621an020eg 16 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f1621vn020eg 16 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f1622ar020eg 16 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f1622vs020eg 16 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package automotive/industrial temperature: ?40c to +125c z8f1621pm020ag 16 kb 2 kb 29 23 3 8 1 1 2 pdip 40-pin package z8f1621an020ag 16 kb 2 kb 31 23 3 8 1 1 2 lqfp 44-pin package z8f1621vn020ag 16 kb 2 kb 31 23 3 8 1 1 2 plcc 44-pin package z8f1622ar020ag 16 kb 2 kb 46 24 4 12 1 1 2 lqfp 64-pin package z8f1622vs020ag 16 kb 2 kb 46 24 4 12 1 1 2 plcc 68-pin package z8f64200100kitg development kit zusbsc00100zacg usb smart cable accessory kit zusboptsc01zacg opto-is olated usb smart cable accessory kit zenetsc0100zacg ethernet smart cable accessory kit table 271. z8 encore! xp f64xx series ordering matrix part number flash ram i/o lines interrupts 16-bit timers w/pwm 10-bit a/d channels i 2 c spi uarts with irda description
ps019924-0113 p r e l i m i n a r y part number suffix designations z8 encore! xp ? f64xx series product specification 292 part number suffix designations zilog part numbers consist of a number of co mponent. in the following example, part num- ber z8f6421an020sg is an 8-bit flash mcu with 4 kb of program memory in a 44-pin lqfp package, operating with a maximum 20 mhz external clock frequency over a 0oc to +70oc temperature range and built using environmentally friendly (lead-free) solder. z8 f 64 21 a n 020 s c environmental flow ? g = lead free package temperature range (c) s = standard, 0 to 70 ? e = extended, ?40 to +105 a = automotive/industrial, ?40 to +125 speed ? 020 = 20 mhz pin count ? m = 40 pins, n = 44 pins, r = 64 pins, s = 68 pins, t = 80 pins package a = lqfp f = qfp p = pdip ? v = plcc device type 21 = devices with 29 or 31 i/o lines, 23 inter- rupts, 3 timers and 8 adc channels 22 = devices with 46 i/o lines, 24 interrupts, 4 timers and 12 adc channels 23 = devices with 60 i/o lines, 24 interrupts, 4 timers and 12 adc channels memory size ? 64 kb flash, 4 kb ram ? 48 kb flash, 4 kb ram ? 32 kb flash, 2 kb ram ? 24 kb flash, 2 kb ram ? 16 kb flash, 2 kb ram memory type ? f = flash device family
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 293 index numerics 10-bit adc 5 a absolute maximum ratings 201 ac characteristics 217 adc 231 architecture 162 automatic power-down 164 block diagram 163 continuous conversion 165 control register 166 control register definitions 166 data high byte register 168 data low bits register 169 dma control 166 electrical characteristics and timing 215 operation 164 single-shot conversion 164 adcctl register 166 adcdh register 168 adcdl register 169 adcx 231 add 231 add - extended addressing 231 add with carry 231 add with carry - extended addressing 231 additional symbols 229 address space 19 addx 231 analog signals 16 analog-to-digital co nverter (adc) 162 and 234 andx 234 arithmetic instructions 231 assembly language programming 226 assembly language syntax 227 b baud rate generator, uart 99 bclr 232 binary number suffix 229 bit 232 bit 228 clear 232 manipulation instructions 232 set 232 set or clear 232 swap 232 test and jump 234 test and jump if non-zero 234 test and jump if zero 234 bit jump and test if non-zero 234 bit swap 235 block diagram 4 block transfer instructions 232 brk 234 bset 232 bswap 232, 235 btj 234 btjnz 234 btjz 234 c call procedure 234 capture mode 79 capture/compare mode 79 cc 228 ccf 233 characteristics, electrical 201 clear 233 clock phase (spi) 117 clr 233 com 234 compare 79 compare - extended addressing 231 compare mode 79
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 294 compare with carry 231 compare with carry - ex tended addressing 231 complement 234 complement carry flag 232, 233 condition code 228 continuous conversion (adc) 165 continuous mode 79 control register definition, uart 99 control register, i2c 145 counter modes 79 cp 231 cpc 231 cpcx 231 cpu and peripheral overview 4 cpu control instructions 233 cpx 231 customer feedback form 305 customer feedback form 294 customer information 305 d da 228, 231 data register, i2c 142 dc characteristics 203 debugger, on-chip 184 dec 231 decimal adjust 231 decrement 231 decrement and jump non-zero 234 decrement word 231 decw 231 destination operand 229 device, port availability 37 di 233 direct address 228 direct memory access controller 151 disable interrupts 233 djnz 234 dma address high nibble register 156 configuring dma0-1 data transfer 151 configuring for dma_adc data transfer 153 control of adc 166 control register 154 control register definitions 153 controller 6 dma_adc address register 158 dma_adc control register 159 dma_adc operation 152 end address low byte register 157 i/o address register 155 operation 151 start/current address low byte register 157 status register 160 dmaa_stat register 160 dmaactl register 159 dmaxctl register 154, 268, 269 dmaxend register 157, 269, 270 dmaxh register 156, 268, 270 dmaxi/o address (dmaxio) 155, 268, 269 dmaxio register 155, 268, 269 dmaxstart register 157, 268, 270 dst 229 e ei 233 electrical characteristics 201 adc 215 flash memory and timing 214 gpio input data sample timing 218 watch-dog timer 214 enable interrupt 233 er 228 extended addressing register 228 external pin reset 33 external rc oscillator 213 ez8 cpu features 4 ez8 cpu instruction classes 231 ez8 cpu instruction notation 228 ez8 cpu instruction set 226 ez8 cpu instruction summary 235 f fctl register 177, 285 features, z8 encore! 1
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 295 first opcode map 247 flags 229 flags register 229 flash controller 5 option bit address space 181 option bit configuration - reset 181 program memory address 0001h 183 flash memory arrangement 171 byte programming 174 code protection 173 configurations 170 control register definitions 176 controller bypass 175 electrical characteristics and timing 214 flash control register 177, 285 flash status register 178 frequency high and low byte registers 180 mass erase 175 operation 172 operation timing 172 page erase 175 page select register 178 fps register 178 fstat register 178 g gated mode 79 general-purpose i/o 37 gpio 5, 37 alternate functions 38 architecture 38 control register definitions 40 input data sample timing 218 interrupts 40 port a-h address registers 41 port a-h alternate fu nction sub-registers 43 port a-h control registers 42 port a-h data direction sub-registers 42 port a-h high drive enable sub-registers 45 port a-h input data registers 47 port a-h output control sub-registers 44 port a-h output data registers 47 port a-h stop mode recovery sub-registers 46 port availability by device 37 port input timing 218 port output timing 219 h h 229 halt 233 halt mode 36, 233 hexadecimal number prefix/suffix 229 i i2c 5 10-bit address read transaction 140 10-bit address transaction 137 10-bit addressed slave data transfer format 137 10-bit receive data format 140 7-bit address transaction 134 7-bit address, reading a transaction 139 7-bit addressed slave data transfer format 134, 135, 136 7-bit receive data transfer format 139 baud high and low byte registers 146, 148, 150 c status register 143, 263 control register definitions 142 controller 129 controller signals 15 interrupts 131 operation 130 sda and scl signals 131 stop and start conditions 133 i2cbrh register 147, 148, 150, 263, 264 i2cbrl register 147, 263 i2cctl register 145, 263 i2cdata register 143, 262 i2cstat register 143, 263 im 228 immediate data 228 immediate operand prefix 229 inc 231 increment 231
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 296 increment word 231 incw 231 indexed 229 indirect address prefix 229 indirect register 228 indirect register pair 228 indirect working register 228 indirect working register pair 228 infrared encoder/decoder (irda) 110 instruction set, ez8 cpu 226 instructions adc 231 adcx 231 add 231 addx 231 and 234 andx 234 arithmetic 231 bclr 232 bit 232 bit manipulation 232 block transfer 232 brk 234 bset 232 bswap 232, 235 btj 234 btjnz 234 btjz 234 call 234 ccf 232, 233 clr 233 com 234 cp 231 cpc 231 cpcx 231 cpu control 233 cpx 231 da 231 dec 231 decw 231 di 233 djnz 234 ei 233 halt 233 inc 231 incw 231 iret 234 jp 234 ld 233 ldc 233 ldci 232, 233 lde 233 ldei 232 ldx 233 lea 233 load 233 logical 234 mult 232 nop 233 or 234 orx 234 pop 233 popx 233 program control 234 push 233 pushx 233 rcf 232, 233 ret 234 rl 235 rlc 235 rotate and shift 235 rr 235 rrc 235 sbc 232 scf 232, 233 sra 235 srl 235 srp 233 stop 233 sub 232 subx 232 swap 235 tcm 232 tcmx 232 tm 232 tmx 232 trap 234 watch-dog timer refresh 233
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 297 xor 234 xorx 234 instructions, ez8 classes of 231 interrupt control register 62 interrupt controller 6, 48 architecture 48 interrupt assertion types 51 interrupt vectors and priority 51 operation 50 register definitions 52 software interru pt assertion 52 interrupt edge select register 61 interrupt port select register 61 interrupt request 0 register 52 interrupt request 1 register 54 interrupt request 2 register 55 interrupt return 234 interrupt vector listing 48 interrupts not acknowledge 131 receive 131 spi 121 transmit 131 uart 97 introduction 1 ir 228 ir 228 irda architecture 110 block diagram 110 control register definitions 113 operation 110 receiving data 112 transmitting data 111 iret 234 irq0 enable high and low bit registers 56 irq1 enable high and low bit registers 57 irq2 enable high and low bit registers 59 irr 228 irr 228 j jp 234 jump, conditional, relative, and relative conditional 234 l ld 233 ldc 233 ldci 232, 233 lde 233 ldei 232, 233 ldx 233 lea 233 load 233 load constant 232 load constant to/from program memory 233 load constant with auto-increment addresses 233 load effective address 233 load external data 233 load external data to/fro m data memory and auto- increment addresses 232 load external to/from data memory and auto-incre- ment addresses 233 load instructions 233 load using extended addressing 233 logical and 234 logical and/extended addressing 234 logical exclusive or 234 logical exclusive or/extended addressing 234 logical instructions 234 logical or 234 logical or/extended addressing 234 low power modes 35 m master interrupt enable 50 master-in, slave-out and-in 116 memory program 20 miso 116 mode capture 79 capture/compare 79 continuous 79
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 298 counter 79 gated 79 one-shot 79 pwm 79 modes 79 mult 232 multiply 232 multiprocessor mode, uart 94 n nop (no operation) 233 not acknowledge interrupt 131 notation b 228 cc 228 da 228 er 228 im 228 ir 228 ir 228 irr 228 irr 228 p 228 r 228 r 228 ra 229 rr 229 rr 229 vector 229 x 229 notational shorthand 228 o ocd architecture 184 auto-baud detector/generator 187 baud rate limits 187 block diagram 184 breakpoints 188 commands 189 control register 194 data format 187 dbg pin to rs-232 interface 185 debug mode 186 debugger break 234 interface 185 serial errors 188 status register 195 timing 220 ocd commands execute instruction (12h) 193 read data memory (0dh) 193 read ocd control re gister (05h) 191 read ocd revision (00h) 190 read ocd status register (02h) 191 read program counter (07h) 191 read program memory (0bh) 192 read program memory crc (0eh) 193 read register (09h) 192 step instruction (10h) 193 stuff instruction (11h) 193 write data memory (0ch) 192 write ocd control register (04h) 191 write program counter (06h) 191 write program memory (0ah) 192 write register (08h) 191 on-chip debugger 6 on-chip debugger (ocd) 184 on-chip debugger signals 17 on-chip oscillator 197 one-shot mode 79 opcode map abbreviations 245 cell description 245 first 247 second after 1fh 248 or 234 ordering information 288 orx 234 oscillator signals 17 p p 228 packaging 287 part number description 293
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 299 part selection guide 2 pc 229 peripheral ac and dc electrical characteristics 212 phase=0 timing (spi) 118 phase=1 timing (spi) 119 pin characteristics 18 polarity 228 pop 233 pop using extended addressing 233 popx 233 port availability, device 37 port input timing (gpio) 218 port output timing, gpio 219 power supply signals 17 power-down, automatic (adc) 164 power-on and voltage brown-out 212 power-on reset (por) 31 program control instructions 234 program counter 229 program memory 20 push 233 push using extended addressing 233 pushx 233 pwm mode 79 pxaddr register 41, 275, 276, 277, 278, 279, 280, 281, 282 pxctl register 42, 275, 276, 277, 278, 279, 280, 281, 282 r r 228 r 228 ra register address 229 rcf 232, 233 receive 10-bit data format (i2c) 140 7-bit data transfer format (i2c) 139 irda data 112 receive interrupt 131 receiving uart data-interrupt-driven method 93 receiving uart data-polled method 92 register 126, 155, 228, 265, 268, 269 adc control (adcctl) 166 adc data high byte (adcdh) 168 adc data low bits (adcdl) 169 baud low and high byte (i2c) 146, 148, 150 baud rate high and low byte (spi) 127 control (spi) 123 control, i2c 145 data, spi 122 dma status (dmaa_stat) 160 dma_adc address 158 dma_adc control dmaactl) 159 dmax address high nibble (dmaxh) 156, 268, 270 dmax control (dmaxctl) 154, 268, 269 dmax end/address low byte (dmaxend) 157, 269, 270 dmax start/current address low byte register (dmaxstart) 157, 268, 270 flash control (fctl) 177, 285 flash high and low byte (ffreqh and fre- eql) 180 flash page select (fps) 178 flash status (fstat) 178 gpio port a-h address (pxaddr) 41, 275, 276, 277, 278, 279, 280, 281, 282 gpio port a-h alternate function sub-registers 43 gpio port a-h control address (pxctl) 42, 275, 276, 277, 278, 279, 280, 281, 282 gpio port a-h data direction sub-registers 42 i2c baud rate high (i2cbrh) 147, 148, 150, 263, 264 i2c control (i2cctl) 145, 263 i2c data (i2cdata) 143, 262 i2c status 143, 263 i2c status (i2cstat) 143, 263 i2cbaud rate low (i2cbrl) 147, 263 mode, spi 126 ocd control 194 ocd status 195 spi baud rate high byte (spibrh) 128, 266 spi baud rate low byte (spibrl) 128, 266 spi control (spictl) 123, 265 spi data (spidata) 123, 264
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 300 spi status (spistat) 124, 265 status, i2c 143 status, spi 124 uartx baud rate high byte (uxbrh) 107, 259, 262 uartx baud rate low byte (uxbrl) 107, 260, 262 uartx control 0 (uxctl0) 103, 106, 258, 259, 261 uartx control 1 (uxctl1) 104, 259, 261 uartx receive data (uxrxd) 100, 258, 260 uartx status 0 (uxstat0) 101, 258, 260 uartx status 1 (uxstat1) 102, 259, 261 uartx transmit data (uxtxd) 100, 258, 260 watchdog timer control (wdtctl) 85, 283 watchdog timer reload high byte (wdth) 87, 284 watchdog timer reload low byte (wdtl) 87, 284 watchdog timer reload upper byte (wdtu) 86, 283 register file 19 register file address map 23 register pair 229 register pointer 229 reset and stop mode characteristics 29 carry flag 232 controller 6 sources 30 ret 234 return 234 rl 235 rlc 235 rotate and shift instructions 235 rotate left 235 rotate left through carry 235 rotate right 235 rotate right th rough carry 235 rp 229 rr 229, 235 rr 229 rrc 235 s sbc 232 scf 232, 233 sda and scl (irda) signals 131 second opcode map after 1fh 248 serial clock 117 serial peripheral interface (spi) 114 set carry flag 232, 233 set register pointer 233 shift right arithmetic 235 shift right logical 235 signal descriptions 15 single-shot conversion (adc) 164 sio 6 slave data transfer formats (i2c) 137 slave select 117 software trap 234 source operand 229 sp 229 spi architecture 114 baud rate generator 121 baud rate high and low byte register 127 clock phase 117 configured as slave 115 control register 123 control register definitions 122 data register 122 error detection 120 interrupts 121 mode fault error 120 mode register 126 multi-master operation 119 operation 116 overrun error 120 signals 116 single master, multiple slave system 115 single master, single slave system 114 status register 124 timing, phase = 0 118 timing, phase=1 119 spi controller signals 15 spi mode (spimode) 126, 265 spibrh register 128, 266
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 301 spibrl register 128, 266 spictl register 123, 265 spidata register 123, 264 spimode register 126, 265 spistat register 124, 265 sra 235 src 229 srl 235 srp 233 stack pointer 229 status register, i2c 143 stop 233 stop mode 35, 233 stop mode recovery sources 33 using a gpio port pin transition 34 using watchdog timer time-out 34 sub 232 subtract 232 subtract - extended addressing 232 subtract with carry 232 subtract with carry - extended addressing 232 subx 232 swap 235 swap nibbles 235 symbols, additional 229 system and core resets 30 t tcm 232 tcmx 232 test complement under mask 232 test complement under mask - extended addressing 232 test under mask 232 test under mask - extended addressing 232 timer signals 16 timers 6, 63 architecture 63 block diagram 64 capture mode 69, 79 capture/compare mode 71, 79 compare mode 70, 79 continuous mode 65, 79 counter mode 66 counter modes 79 gated mode 71, 79 one-shot mode 64, 79 operating mode 64 pwm mode 67, 79 reading the timer count values 72 reload high and low byte registers 75 timer control register definitions 73 timer output signal operation 73 timers 0-3 control 0 registers 77 control 1 registers 78 high and low byte registers 73, 76 tm 232 tmx 232 transmit irda data 111 transmit interrupt 131 transmitting uart data-interrupt-driven method 91 transmitting uart data-polled method 90 trap 234 u uart 5, 88 architecture 88 asynchronous data form at without/with parity 90 baud rate generator 99 baud rates table 108 control register definitions 99 controller signals 16 interrupts 97 multiprocessor mode 94 receiving data using in terrupt-driven method 93 receiving data using the polled method 92 transmitting data using the interrupt-driven method 91 transmitting data using the polled method 90 x baud rate high and low registers 106 x control 0 and control 1 registers 103
ps019924-0113 p r e l i m i n a r y index z8 encore! xp ? f64xx series product specification 302 x status 0 and status 1 registers 101, 102 universal asynchronous receiver/transmitter 88 uxbrh register 107, 259, 262 uxbrl register 107, 260, 262 uxctl0 register 103, 106, 258, 259, 261 uxctl1 register 104, 259, 261 uxrxd register 100, 258, 260 uxstat0 register 101, 258, 260 uxstat1 register 102, 259, 261 uxtxd register 100, 258, 260 v vector 229 voltage brownout reset (vbr) 32 w watch-dog timer approximate time-out delay 82 cntl 32 control register 84 refresh 82 watchdog timer electrical characteristics and timing 214 interrupt in normal operation 82 interrupt in stop mode 82 refresh 233 reload unlock sequence 83 reload upper, high and low registers 86 reset 33 reset in normal operation 83 reset in stop mode 83 time-out response 82 wdtctl register 85, 283 wdth register 87, 284 wdtl register 87, 284 working register 228 working register pair 229 wtdu register 86, 283 x x 229 xor 234 xorx 234 z z8 encore! block diagram 4 features 1 introduction 1 part selection guide 2
ps019924-0113 p r e l i m i n a r y customer support z8 encore! xp ? f64xx series product specification 303 customer support to share comments, get your technical questio ns answered or report issues you may be experiencing with our products, please visit zilog?s technical support page at ? http://support.zilog.com . to learn more about this product, find additio nal documentation or to discover other facets about zilog product offerings, plea se visit the zilog knowledge base at http://zilog.com/ kb or consider participating in the zilog forum at http://zilog.com/forum . this publication is subject to replacement by a later edition. to determine whether a later edition exists, please vis it the zilog website at http://www.zilog.com .


▲Up To Search▲   

 
Price & Availability of Z8F4822AR020SG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X